Search code examples
sqldatabaseoracle-databaserownum

SQL ROWNUM how to return rows between a specific range


How can I return a specific range of ROWNUM values?

I'm trying the following:

select * from maps006 where rownum >49 and rownum <101

This returns only rows matching the < operator.


Solution

  •  SELECT * from
     (
     select m.*, rownum r
     from maps006 m
     )
     where r > 49 and r < 101