oracle sort | Sort sql | Sorting - oracle tutorial - sql tutorial
How to sort data using Oracle ORDER BY clause?
- The Oracle ORDER BY clause is used to sort the data in ascending or descending order, based on one or more columns.
- The ORDER BY keyword sorts the records in ascending order by default. To sort the records in descending order, use the DESC keyword.

Oracle sorting order by
Syntax:
SELECT column-list
FROM table_name
[WHERE condition]
[ORDER BY column1, column2, .. columnN] [ASC | DESC];
click below button to copy the code. By - oracle tutorial - team
Example:
SELECT * FROM wikitechy_employee
ORDER BY NAME;
click below button to copy the code. By - oracle tutorial - team
Sample Database:
- Consider the wikitechy_employee table having the following records:

Sorting:

- The above query would sort the result in ascending order by NAME.
- Database sorts query results in ascending order by default.
Note: Similarly results can be sorted in descending order using DESC keyword.