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 -> Using Ranges in DECODE function -- Possible???

Using Ranges in DECODE function -- Possible???

From: <swhedges_at_my-deja.com>
Date: 2000/06/28
Message-ID: <8jdo0p$ti4$1@nnrp1.deja.com>#1/1

is it possible to utilize a range of values in the Search fields?

 example:

 decode(tenure,between 0 and 30, 1, 0)

 seems like it ought to work, but everytime i try this syntax SQL Plus says "Missing Expression"

 if i try writing it like such:

 decode(tenure,tenure between 0 and 30, 1, 0)

 i'm told "missing right parenthesis" starting at the between

 i can't believe that i would have to write the query like this:

 decode(tenure,0,1,
               1,1,
               2,1,
               3,1,
               etc,etc from 4 through 30
                 0)

 do I???

 thanks in advance

 stuart

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Wed Jun 28 2000 - 00:00:00 CDT

Original text of this message

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