You can use FIND_IN_SET to do that:
SELECT * FROM tablename WHERE id IN (1,10,8,5) ORDER BY FIND_IN_SET(id, ‘1,10,8,5’)
Attention in classroom
You can use FIND_IN_SET to do that:
SELECT * FROM tablename WHERE id IN (1,10,8,5) ORDER BY FIND_IN_SET(id, ‘1,10,8,5’)