How are you?...Tim! I have a fairly simple query which returns huge amount of records (around 75000). I want to implement paging in its result set. That I may want to fetch records from ROWNUM between 500 and 1000, and consequently 1001 - 1500 etc. This means I don't need to fetch all the records. I just need chunks of data based on Page Number and Page Size. What I have currently done about it is:
Code: Select all
SELECT * from
SELECT id, name, ROWNUM as rownumber from Customer
where rownumber between 500 and 1000
In above example 500 and 1000 are predetermined variable values.
As you can see, every time I need to fetch the next chunk, I have to fetch all the records first and then have to filter out the required resultset. I want to achieve this in a single query like we use LIMIT and OFFSET in mysql etc. How would you implement paging in this case. I am using ORACLE 10g
Waiting for your reply.