What is the way to do this in 1 select statement
if field1 < feild2 then
With Decode its like this
DECODE((1-SIGN(1-SIGN(field1 - field2))),1,field1,
NULL, 'Value is null',
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))
Click Here to Expand Forum to Full Width