Stay informed about any major changes. Click here to subscribe
Sorting rows
You can order the rows in a query result. You
can name a particular column or set of columns whose values determine
the order of rows in the results. You can arrange rows in ascending or
descending order. An example SQL of an ascending sorting might look like
this:
Results in the Price column will arranged
with the least expensive product first. You can indicate that the result
rows should be arranged by descending values of the price column. This
will arrange the titles with the more expensive books first. The resulting
SQL might look like this:
Multiple sort columns can be specified. The
sequence of the sort columns in the ORDER BY clause defines the organization
of the sorted result set: