Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Logical Operations in SQL decode function ?

696393Apr 30 2009 — edited Apr 30 2009
Hi,
Is it possible to do Logical Operations in SQL decode function

like
'>'
'<'
'>='
'<='
'<>'
not in
in
not null
is null

eg...

select col1 ,order_by,decode ( col1 , > 10 , 0 , 1)
from tab;

select col1 ,order_by,decode ( col1 , <> 10 , 0 , 1)
from tab;

select col1 ,order_by,decode ( col1 , not in (10,11,12) , 0 , 1)
from tab;

select col1 ,order_by,decode ( col1 ,is null , 0 , 1)
from tab;




Regards,

infan

Edited by: user780731 on Apr 30, 2009 12:07 AM

Edited by: user780731 on Apr 30, 2009 12:07 AM

Edited by: user780731 on Apr 30, 2009 12:08 AM

Edited by: user780731 on Apr 30, 2009 12:08 AM

Edited by: user780731 on Apr 30, 2009 12:09 AM
This post has been answered by BluShadow on Apr 30 2009
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 28 2009
Added on Apr 30 2009
4 comments
1,374 views