Getting n of m rows in a query – Oracle 9i and +

select *
from (
select a.*, rownum rnum
from ( YOUR_QUERY_GOES_HERE — including the order by ) a
where rownum <= MAX_ROWS
)
where rnum >= MIN_ROWS

Leave a Reply

Your email address will not be published. Required fields are marked *

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.