| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.server -> Re: mssql server syntax equivalent for oracle
On Fri, 13 Apr 2001 16:25:19 +0200, "Christian" <nomail_at_hips.doc> wrote:
>what would be the "Oracle" translation of the following "case" select ?
>
>SELECT CUSTOMERID,
> case when CUSTNAME is null then "no name"
> else CUSTNAME as NAME
> end
>FROM CUSTOMERS
DECODE can be used, but in this case I prefer:
SELECT CUSTOMERID,
NVL(CUSTNAME,'no name')
FROM CUSTOMERS
That is the correct function to apply for NULL values.
Cheers
Nuno Souto
nsouto_at_bigpond.net.au.nospam
http://www.users.bigpond.net.au/the_Den/index.html
Received on Sat Apr 14 2001 - 06:56:17 CDT
![]() |
![]() |