Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: limiting number of rows returned in sql query

Re: limiting number of rows returned in sql query

From: gateway <gateway_at_tc.umn.edu>
Date: Fri, 21 Jun 2002 11:48:19 -0500
Message-ID: <3D1358D2.10C1E904@tc.umn.edu>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US