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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Correct syntax for 'CASE WHEN' clause

Re: Correct syntax for 'CASE WHEN' clause

From: Stephan Born <stephan.born_at_beusen.de>
Date: Tue, 21 Mar 2000 16:11:06 +0100
Message-ID: <38D7910A.26675CDA@beusen.de>

Bob schrieb:

> I'm getting the following error trying to use a 'CASE WHEN' expression in a
> SELECT statement.
>
> SQL> select case when contract_coupon_type = 'm'
> 2 then 'Manufacturer'
> 3 else 'Retailer'
> 4 end as x
> 5 from contract_t;
> select case when contract_coupon_type = 'm'

select decode (contract_coupon_type, 'm', 'Manufacturer', 'Retailer') from contract_t;

>
> I can't find any reference to 'CASE WHEN' in the online Oracle docs.
> Does Oracle support this? If not, how do I implement equivalent
> functionality? If so, what am I doing wrong?

As far as I know CASE WHEN is not Standard-SQL....on which database does this stament run?

Oracle does not support it...use decode instead.

Regards, Stephan

--


Dipl.-Inf. (FH) Stephan Born   | beusen Consulting GmbH
fon: +49 30 549932-0           | Landsberger Allee 392
fax: +49 30 549932-21          | 12681 Berlin
mailto:stephan.born_at_beusen.de  | Germany
---------------------------------------------------------------
       PGP-Key verfügbar       |      PGP-Key available
---------------------------------------------------------------


Received on Tue Mar 21 2000 - 09:11:06 CST

Original text of this message

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