Ordering by Rowids

You can specify the ROWID keyword in the ORDER BY clause. This specifies the rowid column, a hidden column in nonfragmented tables and in fragmented tables that were created with the WITH ROWIDS clause. The rowid column contains a unique internal record number that is associated with a row in a table. (It is recommended, however, that you utilize primary keys as your access method, rather than exploiting the rowid column.)

The ORDER BY clause cannot specify the rowid column if the table from which you are selecting is a fragmented table that has no rowid column.

You do not need to include the ROWID keyword in the Projection clause when you specify ROWID in the ORDER BY clause.

For further information about rowid values and how to use the rowid column in column expressions, see WITH ROWIDS Option and Using Rowids.