Oracle ORDER BY Clause Guide
To sort by a specific column, you can use the ORDER BY clause. For example, if you want to sort in ascending order by a column named “column_name”, you can write it like this:
SELECT * FROM table_name
ORDER BY column_name;
To sort in descending order, you can add the DESC keyword after the column name.
SELECT * FROM table_name
ORDER BY column_name DESC;
If you want to sort by multiple columns, you can list these columns in the ORDER BY clause separated by commas.
SELECT * FROM table_name
ORDER BY column1, column2;