Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: PL/SQL help needed
Tony Walby wrote:
> Here is the problem I need to gather data from a table 100 records a a
> time. I need to select 0 -100 then 101 - 200 and so forth I know between
> does not work when using rownum. Plus I see other problems with rownum.
> I was thinking of a cursor with a counter but I do not know how to write
> the pls/sql block any help will be greatly appreciated.
>
> Tony Walby
Or consider this:
SELECT field1, field2, field3
FROM (
SELECT rownum COUNTER, field1, field2, field3
FROM mytable
WHERE rownum <= y)
WHERE COUNTER BETWEEN x AND y;
Now it is horribly inefficient ... but it does do the job you ask.
Daniel A. Morgan Received on Mon Jul 23 2001 - 23:39:19 CDT
![]() |
![]() |