order by given order [message #430914] |
Fri, 13 November 2009 02:02 |
123soleil
Messages: 35 Registered: July 2006
|
Member |
|
|
I feel stupid asking this question but could not find an answer anywhere.
I have the following statement:
select * from clients where id in (5,3,6,4,8,9,1)
I need to return the results in exactly that order. How do I do this?
Many thanks
|
|
|
Re: order by given order [message #430916 is a reply to message #430914] |
Fri, 13 November 2009 02:23 |
|
Michel Cadot
Messages: 68727 Registered: March 2007 Location: Saint-Maur, France, https...
|
Senior Member Account Moderator |
|
|
order by decode(id, 5,1, 3,2, 6,3, 4,4, 8,5, 9,6, 1,7)
Regards
Michel
|
|
|
|