split query result into 2 using rownum
Hi everyone,
I have an SQL query that return 75000 records. Because client will be viewing these records in excel and excel only open 65K, I have to provide them 2 csv files.
first csv with 65000 records
second csv with 10000 records.
Hre is the CATCH....I have to be able to do this using 2 separate queries.
First query should return 65000 records
Second query should return the remaining 10000 records.
I am using rownum <=60000 in my first query using (order by rownum ASC) and it works
For the remaining 10000 records, I tried rownum <= 10000 order by rownum DESC. I thought this would give me the remaining 10000 but its not. It includes records already appearing in the result of first query.
How can I split the result set in 1 queries. Is there any other way than rownum??
Thanks for your help.