-
decode?
What is the way to do this in 1 select statement
if field1 < feild2 then
return(field1)
else
return(field2)
end if;
-
-
With Decode its like this
SELECT
DECODE(field1,NULL,'NULL',field1),
DECODE((1-SIGN(1-SIGN(field1 - field2))),1,field1,
NULL, 'Value is null',
field2) result
FROM ur_table
Srini
-
If you need a more general solution than LEAST, use CASE. It's more intuitive than DECODE and it's ANSI.
Srini - you must be joking, or are you?
-
Or how about: LEAST(NVL(f1,f2),NVL(f2,f1))
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
|