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: Help needed for an IF ..THEN...ELSE Construction

Re: Help needed for an IF ..THEN...ELSE Construction

From: Jonathan Lewis <jonathan_at_jlcomp.demon.co.uk>
Date: Wed, 22 Mar 2000 21:59:49 -0000
Message-ID: <953762482.22366.0.nnrp-13.9e984b29@news.demon.co.uk>

If you can use 8.1.6, then the CASE arrives:

select

    case

        when    ( ordervol > 1000 ) then 'fine'
        else    'bad'

    end as foo
from customer;

--

Jonathan Lewis
Yet another Oracle-related web site: http://www.jlcomp.demon.co.uk

M. Pfadenhauer wrote in message <8bbb0i$a94$1_at_wsc10.lrz-muenchen.de>...
>Hi,
>
>is there a way to use an 'IF..THEN..ELSE' construction in SQL. I am using
>Oracle8.
>
>something like this should be done:
>
>select ID as custID, IIF( ordervol > 1000 ; 'fine' ; 'bad' ) as foo
>from customer
>
>the only thing i found in the docs is the DECODE statement. But there is no
>way to use rangeexpression....
>
>thanx for any advice,
>
>markus.pfadenhauer_at_studtum.lrz-muenchen.de
>
>
>
>
Received on Wed Mar 22 2000 - 15:59:49 CST

Original text of this message

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