Oracle Certification - SQL Fundamentals I - ORDER BY Clause
The ORDER BY Clause
The ORDER BY clause only changes the way in which the results of a SELECT statement are presented, it does not change the data that is retrieved. The format of the ORDER BY clause is:
Ascending / Descending Sorts
The default sort order is ascending, i.e. lowest to highest (this is an alphanumeric sort). This can be overridden on a column by column basis using the ASC / DESC commands.
NULLS FIRST / NULLS LAST
The default behaviour is for Oracle to list nulls last. Again this can be override on a column by column basis.
Positional Sorting
There is shorthand way of specifying the sort columns. Instead of specifying the columns names, the position that the column appears in the SELECT list is used instead:The exam will often include questions that test knowledge of the default sort orders..
Next up is Ampersand Substitution.