Andrew Channels Dexter Pinion

Wherein I write some stuff that you may like to read. Or not, its up to you really.

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 AM

CASE 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),

Posted by: Ross Parish on May 1, 2003 02:46 AM