lemmin Posted June 13, 2008 Share Posted June 13, 2008 I really doubt this is possible, but is there a way to order by the same order as a set? For example: SELECT * FROM Table WHERE ID IN (1,4,2,7,5); The ID's would be unique so five rows would be returned and I would want them to be in the order that is specified in the set. Is there anyway I can do something like this? Thanks for any help. Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted June 13, 2008 Share Posted June 13, 2008 See this link - http://www.eklekt.com/tutorials/mysql Quote Link to comment Share on other sites More sharing options...
lemmin Posted June 13, 2008 Author Share Posted June 13, 2008 Wow, I don't even understand why that works. Thanks for showing me that. Quote Link to comment Share on other sites More sharing options...
fenway Posted June 13, 2008 Share Posted June 13, 2008 Actually, that doesn't entirely work as advertised if there are non-matching items to be ordered... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.