Mysql
 sql >> Database >  >> RDS >> Mysql

MySQL - SELECT ... WHERE id IN (..) - ordine corretto

Usa FIELD() :

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