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: Steve <johnst_at_ncs.com>
Date: Fri, 13 Apr 2001 11:47:11 -0500
Message-ID: <3AD72D8F.B549753@ncs.com>

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
  Received on Fri Apr 13 2001 - 11:47:11 CDT

Original text of this message

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