- Instant help with your Sql coding problems

Sort MySQL results

How to sort MySQL results?
SELECT * FROM student ORDER BY birth_date DESC;

SELECT * FROM student ORDER BY rating DESC, name ASC;

The result rows of a SELECT are displayed in no particular order. It is often easier to examine query output when the rows are sorted in some meaningful way. To sort a result, use an ORDER BY clause.

Share "How to sort MySQL results?"
Related snippets:
sql, sorting, results, resultset, order, order by, desc, asc, mysql, mariadb
Technical term:
Sort MySQL results