Re: AW: [HACKERS] isnull() or is it?t - Mailing list pgsql-hackers

From H.Lefebvre
Subject Re: AW: [HACKERS] isnull() or is it?t
Date
Msg-id 366E8F8C.9BA27BA4@easynet.fr
Whole thread Raw
In response to AW: [HACKERS] isnull() or is it?t  (Zeugswetter Andreas IZ5 <Andreas.Zeugswetter@telecom.at>)
Responses Re: AW: [HACKERS] isnull() or is it?t  (Bruce Momjian <maillist@candle.pha.pa.us>)
List pgsql-hackers
Zeugswetter Andreas IZ5 wrote:
> 
>         > isnull() is on our TODO list.
> 
>         It should be called NVL() from "Null VaLue" like in Oracle and
> Informix.
>         isnull() would suggest a boolean return value to me.
> 


With SyBase, IsNull(X,Y) returns X if X is not null, and Y
if X is null.

Example:

SELECT reference, name, IsNull(price, 0.00)
FROM t_items


reference      name           price
------------ --------------- -------
W95          Windows95        190.00
WNT400       Windows NT 4.0   490.00
LX           Linux              0.00


rather than:

SELECT reference, name, price,
FROM t_items


reference      name           price
------------ --------------- -------
W95          Windows95        190.00
WNT400       Windows NT 4.0   490.00
LX           Linux             NULL


--
H.Lefebvre


pgsql-hackers by date:

Previous
From: Zeugswetter Andreas IZ5
Date:
Subject: AW: [HACKERS] isnull() or is it?t
Next
From: "Chris Williams"
Date:
Subject: Error with table that exists but postgres says it doesn't