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

Home -> Community -> Usenet -> c.d.o.misc -> Re: DECODE

Re: DECODE

From: Mark C. Stock <mcstockX_at_Xenquery>
Date: Thu, 1 Apr 2004 17:41:25 -0500
Message-ID: <vN6dnWOHnfYiB_Hd4p2dnA@comcast.com>

"Sherman H." <shung_at_earthlink.net> wrote in message news:PA0bc.11651$lt2.8514_at_newsread1.news.pas.earthlink.net...
| I have to run a query to give a column a value based on a time range. Can
I
| use DECODE?
|
| select decode(trans_date, trans_date>='01-Jul-2002' and
| trans_date<='30-Jun-2003','Fiscal2002', .....) as fiscal,
| from. . .
| where. . .
|
|

not with a nested predicate

look into CASE (if it's supported in the version you're running) or else you'll need to do a more complex expression using TO_DATE, date arithmetic, and the SIGN function

;-{ mcs Received on Thu Apr 01 2004 - 16:41:25 CST

Original text of this message

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