Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: mssql server syntax equivalent for oracle
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