On Mon, Feb 22, 2010 at 6:10 PM, Wade Preston Shearer
<[email protected]> wrote:
> Sorry; here's an example:
>
> SELECT hans.this, hans.that, ISNULL(frans.the, 'default value') as other
> FROM database_hans hans
> LEFT JOIN database_frans frans
>        ON hans.fk=frans.pk



So wouldn't this be the same:

SELECT hans.this, hans.that, COALESCE(frans.the, 'default value') as other
FROM database_hans hans
LEFT JOIN database_frans frans
       ON hans.fk=frans.pk


Since COALESCE will return the first non-null item in the list given
to it.  If frans.the is not null then it will be used, and if it is
null then you'll get back 'default value' since that string will never
be null.

-- 
Joseph Scott
[email protected]
http://josephscott.org/

_______________________________________________

UPHPU mailing list
[email protected]
http://uphpu.org/mailman/listinfo/uphpu
IRC: #uphpu on irc.freenode.net

Reply via email to