create table Sample1 (pk Integer not null primary key, lname Char(20))
insert into Sample1 values (11, 'Bill')
insert into Sample1 values (12, 'Tom')
insert into Sample1 values (13, 'Harry')
insert into Sample1 values (14, 'John')
select S1.pk,S1.lname, count(s2.pk);
from Sample1 as S1 join Sample1 as S2 ;
on S1.pk<=S2.pk ;
group by s2.pk having count(*) between n1 and n2
Set n1=1, n2=100. The next batch, n1=101, n2=200
| How can I return a 100 row cursor result set from an Oracle 8
| stored proc or package? I know this is very easy using SQL Server
| but does not appear to be the case with Oracle.
| Looks like I may need to use a REF cursor in Oracle, but I sure
| could use an example to make it all clear.
| Tom Bellmer