January 22, 2003
Oracle v SQL Server, Part 6 and a bit
Lo and behold, dBforums - Equivalent of Oracle's DECODE function on SQLServer. I love Google
Posted by Andy Todd at January 22, 2003 12:03 PM
Comments
hi
I want an sqlsever equivalent for the 'DECODE ' function in Oracle
and a sample code for using the function
reply ASAP
Thanks & Regards
Raji
Posted by: Rajeswari on March 20, 2003 10:32 AMCASE Command in SQL Server can be used to emulate DECODE.
Example
(CASE when b.SELN_TYPE2_CODE = 'DIRECT'
then
substr(e.descr,1,3)+substr(f.USER_FLD2,1,6)
else
substr(e.descr,1,3)+substr(f.USER_FLD3,1,6)
END),