Hi
My requirement is i need to fetch rows between 2 given rownum like say 10 to 20 , 30 to 40 etc.
The query which i used is
select * from(
select x , rownum record_num from table1
)result_table
where record_num between 10 and 20
The problem now is i want to sort by x and then pick records by the ordered rownumber wise.
i.e Order by x first. You get a set of result set which is ordered and then select records between 10 and 20.
I tried
select * from (
select x , rownum record_num from table1 order by x
)result_table
where record_num between 10 and 20.
This doesn't work as rownum is alloted before order by.
Now how do i proceed.
Any help would be much appreciated.
thanks
My requirement is i need to fetch rows between 2 given rownum like say 10 to 20 , 30 to 40 etc.
The query which i used is
select * from(
select x , rownum record_num from table1
)result_table
where record_num between 10 and 20
The problem now is i want to sort by x and then pick records by the ordered rownumber wise.
i.e Order by x first. You get a set of result set which is ordered and then select records between 10 and 20.
I tried
select * from (
select x , rownum record_num from table1 order by x
)result_table
where record_num between 10 and 20.
This doesn't work as rownum is alloted before order by.
Now how do i proceed.
Any help would be much appreciated.
thanks