ORDER BY

The ORDER BY clause specifies that the database records retrieved be sorted according to the values in a specific field. If you do not use the ORDER BY clause, the program retrieves records in the order in which they appear in the original database. If you specify more than one field after the ORDER BY clause, the program sorts the records according to the values in the first field specified, then, within that sort, the program sorts the records by the values in the second field specified, and so on. The following SQL statement uses the ORDER BY clause:

SELECT
     MYTABLE.'COMPANY',
     MYTABLE.'CITY',
     MYTABLE.'STATE'
FROM
     'MYTABLE' MYTABLE
ORDER BY
     MYTABLE.'STATE' ASC,
     MYTABLE.'CITY' ASC