Re: if-then-else expression in SELECT list

From: Spamed <user_at_hooked.net>
Date: 1996/07/30
Message-ID: <31FE57C4.6782_at_hooked.net>#1/1


Easy,

Use the SIGN function on A-B....

        DECODE(SIGN(A - B),0,<true result>,<false result>)

Martin

Technomation, Inc.

martinb_at_hooked.net

Bill Duttweiler wrote:
>
> Using ACCESS/ODBC/JET I can use the 'iif()'
> function in a SELECT list to do an if-then-else
> test. I've tried using the ORACLE DECODE()
> expression, but it doesn't allow conditions. For
> example,
>
> DECODE(A = B, TRUE, <true reuslt>, <false result>)
>
> gives an error like "missing right parenthesis".
> It just doesn't appear that DECODE() can handle
> condition expressions.
>
> Is there any way to do an if-then-else expression?
>
> Thanks.
>
> Bill
  Received on Tue Jul 30 1996 - 00:00:00 CEST

Original text of this message