Re: if !NULL ? - Mailing list pgsql-general

From Stephan Szabo
Subject Re: if !NULL ?
Date
Msg-id 20020517114252.Y20428-100000@megazone23.bigpanda.com
Whole thread Raw
In response to Re: if !NULL ?  ("McCaffity, Ray (Contractor)" <McCaffityR@epg.lewis.army.mil>)
List pgsql-general
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.


pgsql-general by date:

Previous
From: Mark Wong
Date:
Subject: OSDL Introduces OSDL-DBT-1
Next
From: Doug Fields
Date:
Subject: Re: Force a merge join?