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?