|
database
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Any function in SQL Server similar to decode function in oracle ?Hi,
Is there any function in SQL Server similar to decode function in oracle ? Thanks, Amit I think it can be handled with CASE expressions.
Show quote "Amit20" wrote: > Hi, > > Is there any function in SQL Server similar to decode function in oracle ? > > Thanks, > Amit You can use a CASE expression (ANSI-standard). See the Books Online for
details. An example: SELECT CASE Status WHEN 'A' THEN 'Active' WHEN 'I' THEN 'Inactive' ELSE ''Unknown' END AS Status FROM dbo.MyTable -- Show quoteHope this helps. Dan Guzman SQL Server MVP "Amit20" <Ami***@discussions.microsoft.com> wrote in message news:6AB5BE13-5089-4800-98EF-E780358A9E3A@microsoft.com... > Hi, > > Is there any function in SQL Server similar to decode function in oracle ? > > Thanks, > Amit |
|||||||||||||||||||||||