MySQL Forums
Forum List  »  Newbie

Result set of ids from an IN list
Posted by: Jeff Li
Date: April 18, 2005 11:05AM

I'm selecting data where the id is in a list (ie. SELECT * FROM x_table WHERE id IN (3,4,7,8,9)).

Is there a way to maintain the order of the result set based on the order of the IN list?

For example, if I constructed my IN list to be (3,2,7,6,4), my result set will be returned in that order instead of (2,3,4,6,7).

Thanks.

Options: ReplyQuote


Subject
Written By
Posted
Result set of ids from an IN list
April 18, 2005 11:05AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.