http://www.postgresql.org/docs/9.1/static/functions-conditional.html
states: "The COALESCE
function returns the first of its arguments that is not null. Null is returned only if all arguments are null."
I was having a terrible time understanding this, and looking at the two examples were just as confusing I could not get it to work right.
not sure if others have had the same difficulty, but here are my suggested adjustments:
Then on someones website this made perfect sense to me:
" If the results of the first argument are null, it will return the second."
so I made this example that makes sense:
COALESCE(column,substitute value)