Hello everybody,
I have faced a problem which seems to have no solution.
Let say I have table with large number of records. Basically, I'm doing the following SQL to get the records sorted as I want:
select * from tmp1 where optimizedcondition;
order by sortname into cursor tmp
so, in reality, cursor tmp is just a tmp1 with filter and set order to sortname.
then, I need to skip large number of records to move pointer to next, let say 50000th record in cursor tmp. When I issue Skip 50000 in tmp, then I can not only make cup of coffee but also can make whole dinner < g >. IOW, it runs forever.
I've tried Go 50000 in tmp but it goes to wrong record because of filter and index.
So, the question is how to skip NNNN records in filtered table by oder of sorting in fast manner? Any ideas?
TIA
* Human is a question asked by birth and answered by death. Machine is another kind of question with another kind of answer