Re: IF-like function in Oracle?

From: Ananta Narayanan <anarayan_at_sctcorp.com>
Date: 1995/09/27
Message-ID: <1995Sep27.205554.27178_at_lamont.ldgo.columbia.edu>#1/1


If you are dealing with numbers, the function 'sign' would be of help to you.
 I have used 'decode' combined with 'sign' in a lot of SQL*Plus
scripts.

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!

Views expressed here are my own.
Other Standard disclaimers apply. Received on Wed Sep 27 1995 - 00:00:00 CET

Original text of this message