SELECT * FROM `students` WHERE `id` IN (83,84);
You can use
find_in_set in order by clause:
SELECT * FROM `students` WHERE `id` IN (83,84) ORDER BY FIND_IN_SET(id,'83,84')
Brief note on
MySQL FIND_IN_SET() returns the position of a string if it is present (as a substring) within a list of strings. The string list itself is a string contains substrings separated by ‘,’ (comma) character.
This function returns 0 when search string does not exist in the string list and returns
NULL if either of the arguments is
FIND_IN_SET (search string, string list)
Name Description search string A string which is to be looked for in following list of arguments. string list List of strings to be searched if they contain the search string.
Alternatively you can use
FIELD() function to accomplish that