"DHatheway" <dl********@mmm.com.nospam> wrote in message news:ck**********@tuvok3.mmm.com...
"Daniel Morgan" <da******@x.washington.edu> wrote in message
news:1096932539.547042@yasure... N wrote: What is the function in SQL that works like DECODE in Oracle?"
Thanks,
N
As you know CASE is not the same as DECODE ... but SQL Server hsa no
functionality equivalent to DECODE so you will have to adapt CASE to
do the job.
--
Daniel A. Morgan
University of Washington
da******@x.washington.edu
(replace 'x' with 'u' to respond)
OK, then, what does DECODE do?
DECODE( exp, search1, result1 [,search2, result2]... ) is semantically equivalent to:
CASE exp
when search1 then result1
when search2 then result2
... END
The difference between CASE and DECODE is that CASE also allows the form:
CASE
WHEN exp1 = search1 then result1
WHEN exp2 = search2 then result2
... END
DECODE can't do that.
--
Paul Horan[TeamSybase]
VCI Springfield, Mass
www.vcisolutions.com