--分页查询
-- 1 小量的数据
select * from
(
select d.*,rownum rn from indexTest d where rownum<=20
)
where rn=>11;
--2 --方法二,较稳定,推荐
select * from
(
select row_number() over(order by id) rn,d.*
from indexTest d
)
where rn between 11 and 20;
select * from (
select d.* ,rownum rn from indexTest d order by id
) where rn between 11 and 20;
--方法三,适合少量数据
select * from indexTest where rownum<=20
minus
select * from indexTest where rownum<=11;