3 ms·
You'd have to have something like SELECT id FROM table WHERE id in () ORDER BY FIND_IN_SET(id,""); to get them in a predefined order.
by karipatila 17y ago
You'd have to have something like SELECT id FROM table WHERE id in () ORDER BY FIND_IN_SET(id,""); to get them in a predefined order.
- learnalist 17y agoI have never used FIND_IN_SET. But I use FIELD() http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_field http://dev.mysql.com/doc/refman/5.0/en/string-functions.html... SELECT FROM x WHERE id IN(9,4,22,38,4,..) ORDER BY FIELD(`id`, 9,4,22,38,4,..) That said, I dont know if sql or php is quicker.