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 |
|
henrikop
Constraint Violating Yak Guru
280 Posts |
Posted - 2001-06-14 : 06:36:31
|
| Somehow can't find it in Books Online.I can use the statement SELECT Name, (CASE Gender WHEN 'M' THEN 'Male' ELSE 'Female' END) from tblPeopleBut how can I use the IF..THEN instructionSELECT Name, (IF Status = 'Bored' THEN 10 ELSE 5) as HappyPoints FROM tblPeopleAnd are nested CASE possible?Something like SELECT Name, (CASE Status WHEN 'Bored' THEN (CASE Message WHEN 'Y' THEN 1 ELSE 0 END) ELSE 0 END) From tblPeopleThx,Henri |
|
|
|
|
|