ORDER BY Clause (SELECT Statement)

ORDER BY forces the output of queries to emerge in a particular sequence.

The ORDER BY clause sorts the output. The rows are sorted according to the values in the columns listed:

You can specify ASC (for ascending, the default) or DESC (descending) independently for each column.

Character sets are sorted according to their collations. You can also use integers rather than names to indicate columns. The integers refer to the placement of the column among those in the output, so that the first column is indicated with a "1", the fifth with a "5", and so on. If any output columns are unnamed, you must use a number.

Note: The order of records returned by AcuXDBC is always undefined unless you specify an ORDER BY clause. If a specific returning order is required, you must use the ORDER BY clause.