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

Home -> Community -> Usenet -> c.d.o.server -> Re: Decode

Re: Decode

From: John Darrah <jdarrah_at_veripost.net>
Date: Wed, 3 Apr 2002 16:29:17 +0000 (UTC)
Message-ID: <41a5f45dbc7e5fdc7f03f6e6c44a7adb.36240@mygate.mailgate.org>


You can use DECODE along with SIGN to accomplish this. Example:

SELECT SUM(DECODE(SIGN(mydate - SYSDATE),1,1,0,1,-1,0))   FROM dual

this decode statement basically states that if mydate is >= to sysdate then the column is equal to 1 otherwise it is equal to 0

-- 
Posted via Mailgate.ORG Server - http://www.Mailgate.ORG
Received on Wed Apr 03 2002 - 10:29:17 CST

Original text of this message

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