Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: DECODE
"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