Morning Dan,
where rownum between 10000 and 19999
I get zip. 
That's because rownum is assigned, starting at 1 and incrementing by 1,
only for rows in the final output set.
What you need is something like:
select * from (
select rownum as r, table.stuff
from table
where ....
) where r between 10000 and 19999;
Oracle "knows" about this construct and will "short circuit" the inner
select when it has enough rows. Unless, of course, you have an ORDER BY
clause in which case it must read everything.
Although if I was paging through a huge table in this manner, I'd
probably parameterise the thing with binds, parse once, execute many!
select * from (
select rownum as r, table.stuff
from table
where ....
) where r between :first and (:first + 9998); -- Yes, 9998 is correct!
HTH
Cheers,
Norm. [TeamT]
Information in this message may be confidential and may be legally privileged. If you have received this message by mistake, please notify the sender immediately, delete it and do not copy it to anyone else. We have checked this email and its attachments for viruses. But you should still check any attachment before opening it. We may have to make this message and any reply to it public if asked to under the Freedom of Information Act, Data Protection Act or for litigation. Email messages and attachments sent to or from any Environment Agency address may also be accessed by someone other than the sender or recipient, for business purposes. If we have sent you information and you wish to use it please read our terms and conditions which you can get by calling us on 08708 506 506. Find out more about the Environment Agency at www.environment-agency.gov.uk
Information in this message may be confidential and may be legally privileged. If you have received this message by mistake, please notify the sender immediately, delete it and do not copy it to anyone else.
We have checked this email and its attachments for viruses. But you should still check any attachment before opening it.
We may have to make this message and any reply to it public if asked to under the Freedom of Information Act, Data Protection Act or for litigation. Email messages and attachments sent to or from any Environment Agency address may also be accessed by someone other than the sender or recipient, for business purposes.
If we have sent you information and you wish to use it please read our terms and conditions which you can get by calling us on 08708 506 506. Find out more about the Environment Agency at www.environment-agency.gov.uk