SQL Order By Query.
-
Order By clause being used for sorting query results in ascending or descending order.
-
To sort query results in ascending order, use the keyword ASC.
-
To sort query results in descending order, use the keyword DESC.
Examples
In descending order-
SELECT *
FROM Employees
ORDER BY NAME DESC
In Ascending order-
SELECT *
FROM Employees
ORDER BY NAME ASC