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: DECODE is fine, but where is the IIF ?

Re: DECODE is fine, but where is the IIF ?

From: terryg8 <trg_at_ibm.net>
Date: 1997/11/03
Message-ID: <345E189A.261E@ibm.net>#1/1

Michael G. Schneider wrote:
>
> Beginner's question:
>
> I just learned about the DECODE function. Very good, but what I am missing
> is a way to not compare against certain values, but instead being able to
> code a boolean condition (something like an IIF an Visual Basic). For
> example the following:
>
> DECODE(x<y, TRUE, 'less', FALSE, 'greater')
>
> isn't possible. Or is it somehow?
>
> Michael G. Schneider
>
> mgs_software_at_compuserve.com

For the example stated you could
 decode(least(x,y),x,'less',y,'greater') There are many other functions available that may make decode work for you.

However you may want to look at PL/SQL if you are more comfortable with 'if' statements etc.

Cheers,
Terry Received on Mon Nov 03 1997 - 00:00:00 CST

Original text of this message

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