Re: DECODE or else, a little test...

From: Gopinath Athilat <ykalmoay_at_batelco.com.bh>
Date: 1996/11/13
Message-ID: <32896D9D.706E_at_batelco.com.bh>#1/1


L. Tseng wrote:
>
> DECODE() is probably the most powerful function in Oracle.
>
> For example
>
>
> IF colA = 1 AND colB = 1 THEN 'YES'
> ELSE 'NO'
>
> can be converted as
>
> DECODE(colA, 1, DECODE(colB, 1, 'YES', 'NO'), 'NO')
>
> BUT.....
>
> Can DECODE do the following?
>
> IF colA > 100 THEN 'A'
> ELSIF colA = 100 THEN 'B'
> ELSE 'C'
>
> Thanks,
>
> Leslie
>
DECODE and SIGN would do the trick! Received on Wed Nov 13 1996 - 00:00:00 CET

Original text of this message