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: <www_dba_at_my-deja.com>
Date: Tue, 21 Mar 2000 08:46:02 GMT
Message-ID: <8b7cs7$skr$1@nnrp1.deja.com>


Hi Bob,

Try decode().

HTH. In article <38d690ab_3_at_news.sisna.com>, "Bob" <Bob.Xinsley_at_catmktg.com> wrote:
> 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'
> *
> ERROR at line 1:
> ORA-00923: FROM keyword not found where expected
>
> 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?
>
> Both the table name and column name are valid as:
>
> Select contract_coupon_type from contract_t;
>
> returns valid data.
>
> Thanks,
>
> Bob
>
> Replace 'X' with 'A' to send me mail.
>
>

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Tue Mar 21 2000 - 02:46:02 CST

Original text of this message

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