any efficient way to select data with limit?
707594Mar 9 2011 — edited Mar 10 2011HI
I want to select some rows of my table for showing in a webpage
number of rows is very very much and all of them cannot be showed in one page, so i used paging for my webpage
every page has just 20 rows
problem is here , how to select rows between 400 and 420 ( for example)
i am using this way of query:
select * from
*(*
select col1,col2,col3, rownum as r_n
from my table
where ... and .... and ... and ...
order by id desc
*)*
where r_n between 400 and 420
this query works, but it is slow. i think database first run inner query and select all rows then select those ones that are in my range
is there any other efficient way to do this?