标题: oracel分页 [打印本页] 作者: 朱婵 时间: 2014-2-20 14:44 标题: oracel分页 1.根据ROWID来分
select * from t_xiaoxi where rowid in(select rid from (selectrownum rn,rid from(select rowid rid,cid from
t_xiaoxi order by cid desc) where rownum<10000) wherern>9980) order by cid desc;
执行时间0.03秒
2.按分析函数来分
select * from (select t.*,row_number() over(order by cid desc) rkfrom t_xiaoxi t) where rk<10000 and rk>9980;
执行时间1.01秒
3.按ROWNUM来分
select * from(select t.*,rownum rn from(select * from t_xiaoxiorder by cid desc) t where rownum<10000) where