Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: mssql server syntax equivalent for oracle
SELECT CUSTOMERID,
nvl(CUSTNAME, "no name") as name
FROM CUSTOMERS
-- Our new email address is kennedy-family_at_home.com . "Steve" <johnst_at_ncs.com> wrote in message news:3AD72D8F.B549753_at_ncs.com...Received on Fri Apr 13 2001 - 19:35:14 CDT
> You can use decode or the CASE statement (new in 8i not exactly sure what
> version).
>
> SELECT CASE
> WHEN custname is null THEN 'no name'
> ELSE custname END col1
> FROM customers
> /
>
> Steve J.
>
> Christian wrote:
>
> > hello,
> >
> > i'm trying to port an sql order from SQL Server to Oracle...and i have
some
> > trouble
> >
> > 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
> >
> > any help would be greatly appreciated
> > Christian
>