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: Galen Boyer <galenboyer_at_hotpop.com>
Date: 21 Jun 2002 22:38:09 -0500
Message-ID: <ulm97yfs8.fsf@hotpop.com>


On Fri, 21 Jun 2002, bvh2_at_swbell.net 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 --

You can't really use rownum for this cause you can't guarantee that you will get 4 distinct sets.

> 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).

Well, it seems that you can modify it somehow cause you are thinking about changing a query or, maybe, is the process that is expecting your set of data unchangable, but getting the input is what can change?

It sounds like you might want to make one extra table that has a sequence number and the ids for extraction. Then use a between clause on that sequence and join it to the set of data you are trying to extract.

-- 
Galen deForest Boyer
Sweet dreams and flying machines in pieces on the ground.
Received on Fri Jun 21 2002 - 22:38:09 CDT

Original text of this message

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