Mysql
 sql >> Base de données >  >> RDS >> Mysql

MySQL - SELECT ... WHERE id IN (..) - ordre correct

Utilisez FIELD() :

SELECT * FROM table WHERE id IN (5,4,3,1,6) ORDER BY FIELD(id, 5,4,3,1,6);