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 |
laurillo87
Starting Member
4 Posts |
Posted - 2014-04-15 : 13:39:27
|
HelloI want to change a number to a word, let me show my querySELECT Ready, Tired FROM PEOPLEthe table is like theseReady Tired 1 0 0 1I need to write in the table result a Yes for 1 and No for 0the table have to be like theseReady Tired YES NO NO YESSome here know if what i want to do it's posible? |
|
djj55
Constraint Violating Yak Guru
352 Posts |
Posted - 2014-04-15 : 13:45:33
|
In this case you can use the CASE statementSELECT CASE Ready WHEN 1 THEN 'TRUE' ELSE 'FALSE' END AS Ready, CASE Tried WHEN 1 THEN 'TRUE' ELSE 'FALSE' END AS Tried FROM PEOPLE djj |
|
|
laurillo87
Starting Member
4 Posts |
Posted - 2014-04-15 : 13:58:35
|
djj55, thank you very much, thats the solution, It worked as I neededquote: Originally posted by djj55 In this case you can use the CASE statementSELECT CASE Ready WHEN 1 THEN 'TRUE' ELSE 'FALSE' END AS Ready, CASE Tried WHEN 1 THEN 'TRUE' ELSE 'FALSE' END AS Tried FROM PEOPLE djj
|
|
|
|
|
|