Oracle Database Get row N through M from many rows (before Oracle 12c)


Example

Use the analytical function row_number():

with t as (
  select col1
  , col2
  , row_number() over (order by col1, col2) rn
  from table
)
select col1
, col2
from t
where rn between N and M; -- N and M are both inclusive

Oracle 12c handles this more easily with OFFSET and FETCH.