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 |
|
raysefo
Constraint Violating Yak Guru
260 Posts |
Posted - 2010-08-13 : 02:30:58
|
| Hi,I m using MS SQL Server. What i would like to do is,In table there is a field x having only 1 or 2. In SELECT statement i would like to show ON for 1 and OFF for 2. How can i do this?Thanks in advance.Best Regards. |
|
|
vaibhavktiwari83
Aged Yak Warrior
843 Posts |
Posted - 2010-08-13 : 02:34:38
|
| SELECT CASE X WHEN 1 THEN 'ON' WHEN 2 THEN 'OFF' END AS Col_X FROM YourTableVaibhav TTo walk FAST walk ALONE To walk FAR walk TOGETHER |
 |
|
|
raysefo
Constraint Violating Yak Guru
260 Posts |
Posted - 2010-08-13 : 02:39:46
|
| thanks so much. |
 |
|
|
vaibhavktiwari83
Aged Yak Warrior
843 Posts |
Posted - 2010-08-13 : 02:49:01
|
WelcomeVaibhav TTo walk FAST walk ALONE To walk FAR walk TOGETHER |
 |
|
|
|
|
|