How can I order the results I get by the order of the ids in the array when using IN statement:
SELECT id,name from table WHERE id IN (23, 33, 55, 2)
I want to get:
+----+---------+
| id | name |
+----+---------+
| 23 | name1 |
| 33 | name2 |
| 55 | name3 |
| 2 | name4 |
+----+---------+
in this order
(23, 33, 55, 2)and(2, 55, 33, 23)will return the IDs in that order. Not just sorting by the id desc/asc.