Wade Preston Shearer wrote: > On 22 Feb 2010, at 17:18, Joseph Scott wrote: > >> On Mon, Feb 22, 2010 at 5:03 PM, Wade Preston Shearer >> <[email protected]> wrote: >> >>> I looked coalesce up and don't see how would work in this case. Will you >>> provide an example? >> You didn't provide a specific query to compare with so hard to say >> exactly how you would use it in your case. > > 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
That is pretty easy, replace ISNULL with COALESCE I also like to use it for preferred names: SELECT COALESCE(preferred, first) AS name FROM people WHERE... Orson (sorry for the dup wps, sent from wrong email first time) _______________________________________________ UPHPU mailing list [email protected] http://uphpu.org/mailman/listinfo/uphpu IRC: #uphpu on irc.freenode.net
