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 |
|
anilkumarkatta
Starting Member
7 Posts |
Posted - 2010-03-21 : 14:09:41
|
| Hi SQLGeeksI am wondering, how I can change the output of the following querrySelect * from employeeDBswhich returns all the coloums. i have a coloum as ActiveStatus which returns 0 as active state and 1 as deactive stateI want my extract showing ActiveStatus as Yes or No isteam of 0 n 1Can any one suggestThanks & Regards,-Anil Katta |
|
|
Sachin.Nand
2937 Posts |
Posted - 2010-03-21 : 14:25:41
|
| select *,case ActiveStatus when 1 then 'Yes' else 'No' end as state from EmployeeDBPBUH |
 |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2010-03-21 : 14:27:40
|
[code]selectcase when ActiveStatus = 0 then 'Yes' when ActiveStatus = 1 then 'No' else 'unknown'end as ActiveStatus,other columns...from tablewhere ...[/code] No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2010-03-21 : 14:28:37
|
 No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
|
|
|