Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: mssql server syntax equivalent for oracle

Re: mssql server syntax equivalent for oracle

From: Nuno Souto <nsouto_at_nsw.bigpond.net.au.nospam>
Date: Sat, 14 Apr 2001 11:56:17 GMT
Message-ID: <3ad83976.4967544@news-server>

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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US