If you are on 8i (I know it works on 8.1.6 and 8.1.7),
you can use select case:
SQL> select * from junk;
X
----------
10
15
20
25
SQL> select x, (case when x < 11 then 'small' when x <
21 then 'med' when x < 31 then 'large' end) from junk
2 /
X (CASE
---------- -----
10 small
15 med
20 med
25 large
SQL>
HTH
Rob Pegram
Oracle Certified DBA
--- Leslie Lu <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> Can decode work on a range, like if Code is > 100
> and
> < 200, then name is A; if code>200 and code<300,
> then
> name is B; .... I have about 20 ranges to check. If
> decode cannot handle that, what's an easy way to do
> that?
>
> Thank you!
>
> Leslie
>
> __________________________________________________
> Do You Yahoo!?
> Find the one for you at Yahoo! Personals
> http://personals.yahoo.com
> --
> Please see the official ORACLE-L FAQ:
> http://www.orafaq.com
> --
> Author: Leslie Lu
> INET: [EMAIL PROTECTED]
>
> Fat City Network Services -- (858) 538-5051 FAX:
> (858) 538-5051
> San Diego, California -- Public Internet
> access / Mailing Lists
>
--------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an
> E-Mail message
> to: [EMAIL PROTECTED] (note EXACT spelling of
> 'ListGuru') and in
> the message BODY, include a line containing: UNSUB
> ORACLE-L
> (or the name of mailing list you want to be removed
> from). You may
> also send the HELP command for other information
> (like subscribing).
__________________________________________________
Do You Yahoo!?
Find the one for you at Yahoo! Personals
http://personals.yahoo.com
--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author: Robert Pegram
INET: [EMAIL PROTECTED]
Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
San Diego, California -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing).