Oracle Database Skipping some rows from result


Example

In Oracle 12g+

SELECT Id, Col1
FROM TableName 
ORDER BY Id
OFFSET 5 ROWS;

In earlier Versions

SELECT Id, 
   Col1
 FROM (SELECT Id,
           Col1,
           row_number() over (order by Id) RowNumber
      FROM TableName)
WHERE RowNumber > 20