ORDER BY Clause
You are looking at an older version of the documentation. The latest version is found here.
The ORDER BY clause specifies how records should be sorted. The options are ASC (ascending) and DESC (descending).
Usage
ORDER BY expression [ASC|DESC] [NULLS (FIRST|LAST)], ...
Syntax Rules
- Sort columns may be specified positionally by a 1-based positional integer, by 
SELECTclause alias name, bySELECTclause expression, or by an unrelated expression; - Column references may appear in the 
SELECTclause as the expression for an aliased column or may reference columns from tables in theFROMclause. If the column reference is not in theSELECTclause the query must not be a set operation, specifySELECT DISTINCT, or contain aGROUP BYclause; - Unrelated expressions, expressions not appearing as an aliased expression in the select clause, are allowed in the order by clause of a non-set 
QUERY. The columns referenced in the expression must come from theFROMclause table references. The column references cannot be to alias names or positional; - The 
ORDER BYcolumns must be of a comparable type; - If an 
ORDER BYis used in an inline view or view definition without a limit clause, the Data Virtuality Server optimizer will remove it; If
NULLS FIRST/LASTis specified, nulls are guaranteed to be sorted either first or last. If the null ordering is not specified, the results will typically be sorted with nulls as low values, which is the Data Virtuality Server's internal default sorting behaviour. However, not all sources return results with nulls sorted as low values by default, and the Data Virtuality Server may return results with different null orderings.The use of positional ordering is no longer supported by the ANSI SQL standard and is a deprecated feature in the Data Virtuality Server. It is preferable to use alias names in the
ORDER BYclause.