I\'m selecting a set of account records from a large table (millions of rows) with integer id values. As basic of a query as one gets, in a sense. What I\'m doing us build
SELECT * FROM your_table
WHERE id IN (5,2,6,8,12,1)
ORDER BY FIND_IN_SET(id,'5,2,6,8,12,1') DESC;
note that the list of ID's in the find_in_set is a string, so its quoted.
Also note that without DESC, they results are returned in REVERSE order to what the list specified.