You should use “ORDER BY FIELD“. So, for instance:
SELECT * FROM table WHERE id IN (118,17,113,23,72)
ORDER BY FIELD(id,118,17,113,23,72)
More Related Contents:
- How does MySQL process ORDER BY and LIMIT in a query?
- Ordering by the order of values in a SQL IN() clause
- Ordering by specific field value first
- MySQL “Group By” and “Order By”
- Using union and order by clause in mysql
- SQL order string as number
- MySQL order by “best match”
- Order by COUNT per value
- MySQL/MariaDB – order by inside subquery
- Mysql: Order by like?
- ORDER BY alphabet first then follow by number
- MYSQL Select One Random record from each Category
- how to delete data from table A besides the customer service and director data in table B?
- SQL split values to multiple rows
- Get records with max value for each group of grouped SQL results
- How to populate a table with a range of dates?
- MySQL order by before group by
- Convert timestamp to date in MySQL query
- Update a column value, replacing part of a string
- MySQL combine two columns into one column
- MySQL Insert Into from one Database in another
- MySQL: LIMIT by a percentage of the amount of records?
- MySQL multiple columns in IN clause
- GROUP BY – do not group NULL
- Composite key as foreign key (sql)
- MySQL 1062 – Duplicate entry ‘0’ for key ‘PRIMARY’
- MySQL LEFT JOIN 3 tables
- MySQL OPTIMIZE all tables?
- Strip last two characters of a column in MySQL
- Deleting a row based on the max value