Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Select First 500 Rows of a Table
Michael wrote:
> I ideally would like to SELECT the first 500 records of a table then
> the NEXT 500 and so forth.
It sounds like you want some form of pagination. Tom Kyte has documented
this well at
http://asktom.oracle.com/pls/ask/f?p=4950:8:305088716325758992::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:127412348064,
and also in his latest book.
select *
from ( select a.*, rownum rnum
from ( YOUR_QUERY_GOES_HERE -- including the order by ) a where rownum <= MAX_ROWS )