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 |
|
jrockfl
Posting Yak Master
223 Posts |
Posted - 2004-08-27 : 09:46:43
|
| Is it possible to order this query by the order in which the ids are hard coded? So it displays in order 17, 9, 20 etc..SELECT *FROM tblLoginsWHERE id IN (17, 9, 20, 11, 25, 15, 8, 7) |
|
|
mfemenel
Professor Frink
1421 Posts |
Posted - 2004-08-27 : 09:51:17
|
| select * from tblloginswhere id in(17,9,20,11,25,15,8,7)order by case id when 17 then 1,when 9 then 2, when 20 then 3....... endyou might have to tweak that case statement a bit but you see where I'm going with it.Mike"oh, that monkey is going to pay" |
 |
|
|
jrockfl
Posting Yak Master
223 Posts |
Posted - 2004-08-27 : 09:53:00
|
| Yes, I see where you are going. Thank you. |
 |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
|
|
|
|
|