方案1 适用于oracle9i以上!
select * from
(select row_number() over(order by sendid desc) rn,m.* from xxt_msgreceive m )
where rn <1010 and rn>=1000
方案2
SELECT * FROM (SELECT A.*, ROWNUM RN FROM (SELECT * FROM xxt_msg where sendstatus=1 order by msgid desc) A WHERE ROWNUM <= 4010)WHERE RN >=4000;
经测试,方案2速度要快
oracle比较快的分页sql
最新推荐文章于 2024-08-19 08:45:16 发布