Oracle分页语句
发布时间:2020-12-12 15:03:35 所属栏目:百科 来源:网络整理
导读:select * from (select * from (select /*+ index_desc(t,idx_dec_1) */ t.*,rownum rn from T_FXZF t where /*reachdate =20150516 and reachdate = 20150529 and*/ t.detectstationtype in (2,3,1)) where rownum = 40) where rn 20; 这算是比较标准的Oracl
select *
from (select * from (select /*+ index_desc(t,idx_dec_1) */ t.*,rownum rn from T_FXZF t where /*reachdate >=20150516 and reachdate <= 20150529 and*/ t.detectstationtype in (2,3,1)) where rownum <= 40) where rn > 20;
这算是比较标准的Oracle分页语句,性能不会差,如果使用between and 或者<和>号都会出现问题,一个是速度慢,二是往后翻页时会出现出不来数据。 使用这个语句是得益于不同结果集中rownum虚列的强大效率。 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |