How to Sort Data in SQL
Need your SQL results in a specific order?
Use ORDER BY.

Common options:
ASCsorts values in ascending orderDESCsorts values in descending order- Sort by one column
- Sort by multiple columns
- Combine sorting with
WHERE
Without ORDER BY, the database does not guarantee the order of returned rows.
If order matters, ask the database to order the results.