Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: Decode greater than syntax

Re: Decode greater than syntax

From: Michael J. Ort <michael_ort_at_my-deja.com>
Date: 2000/04/08
Message-ID: <8cnpuk$qml$1@nnrp1.deja.com>#1/1

Sorry about the syntax error. See below...

In article <8cllat$k8u$1_at_nnrp1.deja.com>,   Michael J. Ort <michael_ort_at_my-deja.com> wrote:
> Using GREATEST is one way, here's another:
>
> What you're basically saying is:
> IF RECEIVED_DT - Sysdate > REQ_DT THEN
> TRUE
> ELSE
> FALSE
> END IF;
>
> RECEIVED_DT - Sysdate > REQ_DT
> RECEIVED_DT - Sysdate - REQ_DT > REQ_DT - REQ_DT
> RECEIVED_DT - Sysdate - REQ_DT > 0
> SIGN(RECEIVED_DT - Sysdate - REQ_DT) > 0
> SIGN(RECEIVED_DT - Sysdate - REQ_DT) = 1 (1=pos, 0=zero, -1=neg)
>
> Therefore, the answer is:
> DECODE(SIGN(RECEIVED_DT - Sysdate - REQ_DT),1,'TRUE',2,'FALSE')
 DECODE(SIGN(RECEIVED_DT - Sysdate - REQ_DT),1,'TRUE','FALSE')
>
> Michael J. Ort

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Sat Apr 08 2000 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US