oracle 分页查询记录

先上sql

select * from (select rownum r ,t.* from (select c.aae135, c.eac001, c.aac003, c.aac004, b.aic020

                from ab01 a, ac04 b, ac01 c

               where a.aaz001 = b.aaz001

                 and c.aac001 = b.aac001

                 and b.eac108 = '0'

                 and a.aab001 = iv_dwbm

                 and b.aae036=(select max(aae036) from ac04) 

               order by b.aae036,b.aaz308 desc) t) where r between v_begin and v_end order by r


基本的写法就是先查询全部数据,再对数据统计行数,再进行分页查询;





posted @ 2018-02-28 14:32  夏天的棒棒冰  阅读(249)  评论(0编辑  收藏  举报