Re: DECODE

From: Thomas J. Kyte <tkyte_at_us.oracle.com>
Date: 1996/12/04
Message-ID: <32a59d11.5793310_at_dcsun4>#1/1


On Wed, 04 Dec 1996 08:50:16 -0800, Les Sprott <les.e.sprott_at_tgpl.twc.com> wrote:

>I am trying to use the following logic in a DECODE statement:
>
>if the ((abs(x/y))-1) > .02 then 'Y' elses 'N'.
>
>any help would be greatly appreciated.
>
>Les Sprott
>Transco Energy

try:

decode( sign( ((abs(x/y))-1) - 0.02 ), 1, 'Y', 'N' )

sign returns -1 if ((abs(x/y))-1)-0.02 is less then zero

              0 if ... = 0
             +1 if ... > 0


Thomas Kyte
Oracle Government
tkyte_at_us.oracle.com                          

http://govt.us.oracle.com

  • Check out Oracle Governments web site! ----- Follow the link to "Tech Center" and then downloadable Utilities for some free software...

statements and opinions are mine and do not necessarily reflect the opinions of Oracle Corporation Received on Wed Dec 04 1996 - 00:00:00 CET

Original text of this message