Ordering by the order of values in a SQL IN() clause
问题 I am wondering if there is away (possibly a better way) to order by the order of the values in an IN() clause. The problem is that I have 2 queries, one that gets all of the IDs and the second that retrieves all the information. The first creates the order of the IDs which I want the second to order by. The IDs are put in an IN() clause in the correct order. So it\'d be something like (extremely simplified): SELECT id FROM table1 WHERE ... ORDER BY display_order, name SELECT name, description