ORDER BY Clause Examples

SQL statement

Description

 

SELECT [Last Name], [First Name]
FROM Employees
ORDER BY [Last Name] DESC

Sorts the records by last name in descending order (Z-A)

SELECT [Category ID], [Product Name], [Unit Price]
FROM Products
ORDER BY [Category ID], [Product Name]

Sorts by category ID first, then by product name