Here is my query
select *
from
(select a.*, rownum rnum
from
(select id, data
from t
order by id) a
where rownum <= HIGHER
)
where rnum >= LOWER;
Say i want to use the innermost query with OrderBy again and again and pass different values of higher and lower. Is not it possible somehow to do it, without actually executing the entire query for each value of higher and lower?
Thanks
rnum >= LOWERfilter that makes it inefficient as Justin pointed out on your other question. Also you haven't answered my question about just fetching the rows in batches rather than querying multiple times. Lastly, have you considered running a single query to partition the data on id and then multiple queries on known id ranges? – Jack Douglas♦ Aug 27 '12 at 9:29