Search notes:

Oracle SQL: SELECT - ORDER BY clause

It's not possible to order a result set on a long data type. Trying to do so causes the error message ORA-00997: illegal use of LONG datatype.
The behavior of order by is influenced by the value of nls_sort.
An order by clause might contain aggregate functions.

See also

Oracle recommends to use deterministic user defined PL/SQL functions if they're used in order by clauses.
The SQL work area in the PGA.
ORA-01791: not a SELECTed expression
Using order by in a view prevents the view from being updatable.

Index