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 |
|
dr223
Constraint Violating Yak Guru
444 Posts |
Posted - 2012-01-17 : 09:40:55
|
Hi, I have a field called 'title' in tbltest. It has 5 values Mr, Mrs, Proffessor, Dr, Other. I have a select query asselect * from dbo.tbltestorder by title Results DrMrMrsOtherProffessorI want it to be; DrMrMrsProffessorOtherIntentionally, keep the 'Other' as the last data value and arranging the other values ascending order..Thanks |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2012-01-17 : 09:45:45
|
order by case when title='Other' then 1 else 0 end, title No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
|
|
|