Oracle Sql to MS Sql Server Language - TechRepublic
Question
January 8, 2009 at 08:00 AM
bbouffor

Oracle Sql to MS Sql Server Language

by bbouffor . Updated 17 years, 6 months ago

In oracle SQL we have a function called “decode” we use in the select statement to replace a returned value with another value.

example
Select decode(cust_id
, 1, JIM
, 2, TOM
, 3 , MARY
, cust_id)
from cust table

I am trying to figure out what how I would accomplish this same process in a SQL Server select statement.

Thanks, and if you can give me a link to some site that might help me figure this type of question out I would appreciate it.

Barb

This discussion is locked

All Comments