ORDER BY

Sorts the result set in ascending or descending order.

Syntax

sql
SELECT * FROM table ORDER BY col1 ASC, col2 DESC;

Example

sql
SELECT name, score
FROM leaderboard
ORDER BY score DESC, name ASC
LIMIT 10;