RE: Decode function
Date: Wed, 29 Jul 2009 13:36:18 -0700
Message-ID: <34DB87F47199374280ADFD2968CDBCFA88143B368A_at_MAIL01KT.seattlepacificindustries.com>
You can also use GREATEST/LEAST to check conditions
Regards,
Eugene Pipko
Seattle Pacific Industries
office: 253.872.5243
cell: 206.304.7726
P Please consider the environment before printing this e-mail.
From: oracle-l-bounce_at_freelists.org [mailto:oracle-l-bounce_at_freelists.org] On Behalf Of Bellows, Bambi (Comsys)
Sent: Wednesday, July 29, 2009 1:34 PM
To: Jeremy.Sheehan_at_fpl.com; Oracle L
Subject: RE: Decode function
Not as such, but I do this all the time by use of the sign function.
For example, if you want to return X if val> 100, Y if it's less, and Z if it's equal , you can do:
select decode(sign(val-100),-1,'X',1,'Y',0,'Z','error') from dual;
From: oracle-l-bounce_at_freelists.org [mailto:oracle-l-bounce_at_freelists.org] On Behalf Of SHEEHAN, JEREMY Sent: Wednesday, July 29, 2009 3:29 PM
To: Oracle L
Subject: Decode function
I think the answer is no, but can you set greater than, less than conditions in a decode function?
TIA!!
Jeremy
P Consider the environment. Please don't print this e-mail unless you really need to.
-- http://www.freelists.org/webpage/oracle-lReceived on Wed Jul 29 2009 - 15:36:18 CDT