日期:2014-05-17  浏览次数:20395 次

Oracle中视图分页查询
我现在有一个视图 v_chaxun,里面有24条记录,以后会逐渐增加,现在要用rwonum实现分页查询,这个语句该怎么写。高手、、、

------解决方案--------------------
select * from (select t.*,rownum rn from t where rownum<100) where rn>90;

------解决方案--------------------
SQL code

with cte as(
    select t.*,rownum rn
    from test_tree t
 ) 
 select *
 from cte c
 where c.rn >10 and c.rn<21
--获取第10到20的记录