Re: IF-like function in Oracle?

From: Pauli Salmu <p.salmu_at_mn.medstroms.se>
Date: 1995/09/27
Message-ID: <44ci1i$b5m_at_zorn.mnet.medstroms.se>#1/1


chuckh_at_ix.netcom.com (Chuck Hamilton) wrote:
>
> Is there an IF like function for SQL. I want to do something like
> this...
>
> IF X > Y
> THEN return value A as the column's value
> ELSE return value B as the column's value
>
> I can use DECODE() if I just want to test for simple coditions like =
> or <>, but I don't know how to make it handle >, <, >=, <=. Do I have
> to write my own custom functions to do this?
> --
> Chuck Hamilton
> chuckh_at_ix.netcom.com
>
> Incoming fire has the right of way!
>

DECODE(SIGN(X-Y),1,'A','B') or something like that... Received on Wed Sep 27 1995 - 00:00:00 CET

Original text of this message