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 |
|
djorre
Yak Posting Veteran
94 Posts |
Posted - 2009-08-13 : 04:48:14
|
| Hi friends,I got a question about ordening:Select Id from tblUnitsResult =>Id (string)910119,10,11I needSelect Id from tblUnitsOrder by ... Result =>Id (string)9,10,1191011How to do this? I have been thinking but not found anything yet. Can you help?Thanks in advance, Joris |
|
|
Nageswar9
Aged Yak Warrior
600 Posts |
Posted - 2009-08-13 : 04:52:11
|
| select * from @temporder by case when id = '9,10,11' then 0 else 1 end |
 |
|
|
Nageswar9
Aged Yak Warrior
600 Posts |
Posted - 2009-08-13 : 04:54:37
|
| ( or )select * from @temporder by case when id like ('9,10,11') then 0 else 1 end |
 |
|
|
bklr
Master Smack Fu Yak Hacker
1693 Posts |
Posted - 2009-08-13 : 04:57:02
|
| select * from tablenameorder by case when charindex(',',id) > 0 then 0 else 1 end |
 |
|
|
|
|
|