


To perform a sorting according to more than one criterion, all sort column names must be entered in the order of their importance. Each column name can be qualified by ASC or DESC. These qualifications can also be mixed.
In the next two examples, the sorting is done according to two criteria, the order - and therefore the importance - of which is interchanged.
In the first case, the main criterion is the city, the secondary criterion the account.
SELECT name, city, account
FROM customer
ORDER BY city, account DESC

In the following example, the main criterion is the account, the secondary criterion the city.
SELECT name, city, account
FROM customer
ORDER BY account DESC, city



