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.
| Author |
Topic |
|
ugh3012
Yak Posting Veteran
62 Posts |
Posted - 2012-06-20 : 15:58:06
|
| I have a SQL statement that looks something like this. Select ID, code, nameFrom tablewhere .....The field name code is a one char field. Is it possible for MS SQL to replace one letter code with the actual code name in the result set. There is no other table for me to inner join to get the code name, so that part is out as there are only 4 different possible codes. for example:instead of retuning - 2403 N Appleit would return - 2403 New Apple |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2012-06-20 : 16:04:39
|
selectID,casewhen code = 'N' then 'New'when code = 'O' then 'Old'end as code,namefrom table No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
|
|
|