Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
hi all i need help from your side i have post query below . SELECT Id,Symptoms, replace (Symptoms,3,'Three')as symptons FROM temp table out put is this -----------------Id Symptoms symptons2003 2 22004 4|3|2| 4|Three|2|3003 2 22005 4|3|2| 4|Three|2|2007 3 Three i need out put-----------------Id Symptoms symptons2003 2 two2004 4|3|2| four|Three|two|3003 2 two2005 4|3|2| four|Three|two|2007 3 ThreeThanks & regardsRajnidas
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts
Posted - 2014-10-09 : 04:26:06
Use CASE:
SELECT Id,Symptoms, case Symptomswhen 1 then 'One'When 2 then 'Two'When 3 then 'Three'-- Write similar cases for other digitselse cast(Symptoms as varchar(10)) end as symptons FROM temp table