|
-
Follow Chris's advice, use CASE if you are on 8.1.6 or higher. If you are not (and I'm also not sure if CASE is already supported inside PL/SQL) then you can use the following:
SELECT
--DECODE(1,
----SIGN(SIGN(col1-25)+SIGN(60-col1)), 1,
----SIGN(SIGN(col1-61)+SIGN(86-col1)), 2,
----SIGN(SIGN(col1-87)+SIGN(112-col1)), 3)
FROM
--table1;
As I've mentioned in another thread, hardly anyone could tell what this construct does by looking at it for just a couple of seconds. On the other hand, if you look at the CASE construct for just one second it is more than clear what is the intention of the code. So, if you can choose between DECODE and CASE it should not really be a very tough decision.
HTH,
Jurij Modic
ASCII a stupid question, get a stupid ANSI
24 hours in a day .... 24 beer in a case .... coincidence?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|