Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: limiting number of rows returned in sql query
In Oracle 8i you can do an "In Line View":
select * from (
select . . . from . . . where . . . order by . . . (any sql you want)
) where rownum < 501
That would get you the first 500 rows of whatever query you run. But you can't say "where rownum between 500 and 1000".
Why do you need to do only a certain number at at time ?
Bob Malos
bvh wrote:
> Is there a way to limit the number of rows returned in a query?
>
> For example, I have a system that has 2,000 records in it. I want to
> pull those records in a batch process 500 at a time with software that
> will do scheduled sql queries -- I just need to figure out how to
> limit the record numbers returned without changing the design to the
> database (its a third party app's database).
>
> Thanks!
Received on Fri Jun 21 2002 - 11:48:19 CDT