The ORDER BY clause indicates the order into which the output is to be sorted. Fields in the output can be specified either by name or by number, and the words ASC or DESC can be used to obtain ascending (the default) or descending order.
For example:
SELECT ol.order_number, c.name
FROM order_header oh, order_line ol, customer c
WHERE oh.order_number=ol.order_number
AND c.customer_number=oh.customer_number
GROUP BY ol.order_number
HAVING SUM(quantity)=5
ORDER BY 2 DESC;
prints order numbers for which at least five items have been ordered, and the corresponding customer names, in descending order of customer name. Notice how aliases, defined after the table names in the FROM clause, are used to reduce the amount of typing.