MySQL Forums
Forum List  »  General

Re: ORDER BY using specific order from IN
Posted by: Björn Steinbrink
Date: May 16, 2006 04:18AM

You can use FIND_IN_SET to do that:
SELECT * FROM tablename WHERE id IN (1,10,8,5) ORDER BY FIND_IN_SET(id, '1,10,8,5')

Options: ReplyQuote


Subject
Written By
Posted
Re: ORDER BY using specific order from IN
May 16, 2006 04:18AM


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.