To sort a result set, you use the ORDER BY clause. The ORDER BY clause takes a list of column names, and the rows in the result set will be sorted in the order that the columns are listed.

Eg. Sorting is employed to arrange data in either ascending or descending order. When a user desires the highest values in a column, sorting in descending order provides that result, whereas sorting in ascending order achieves the opposite.

Last updated