On Fri, 17 May 2002, McCaffity, Ray (Contractor) wrote:
> Is there a way to do to define a default value when doing this?
>
> something like...
>
> select distinct
> uid ....stuff...
>
> e.thingy AS Ifnull(ulk,description,'UNKNOWN'),
>
> ... more stuff ...
>
> As I want to do is have a default value of "UNKNOWN" instead of null.
Well, you can just set a default on the column, although in the
case of foreign keys the default isn't necessarily automatically
allowed unless it's NULL.