Re: IF-like function in Oracle?
From: Kasten10 <kasten10_at_aol.com>
Date: 1995/09/27
Message-ID: <44c6hc$c8n_at_newsbf02.news.aol.com>#1/1
Date: 1995/09/27
Message-ID: <44c6hc$c8n_at_newsbf02.news.aol.com>#1/1
In article <44br37$lsk_at_ixnews2.ix.netcom.com>, chuckh_at_ix.netcom.com (Chuck Hamilton) writes:
>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?
You specifically mentioned SQL, but just in case PL/SQL is an option: YES. Page 3-2 of the PL/SQL User's Guide and Reference.
Chris
If I offend, please excuse - but you never know... Received on Wed Sep 27 1995 - 00:00:00 CET