|Oracle® Database SQL Language Reference
11g Release 1 (11.1)
|PDF · Mobi · ePub|
BY clause to order the rows selected by a query. Sorting by position is useful in the following cases:
To order by a lengthy select list expression, you can specify its position in the
BY clause rather than duplicate the entire expression.
For compound queries containing set operators
BY clause must specify positions or aliases rather than explicit expressions. Also, the
BY clause can appear only in the last component query. The
BY clause orders all rows returned by the entire compound query.
The mechanism by which Oracle Database sorts values for the
BY clause is specified either explicitly by the
NLS_SORT initialization parameter or implicitly by the
NLS_LANGUAGE initialization parameter. You can change the sort mechanism dynamically from one linguistic sort sequence to another using the