赞
踩
先上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
基本的写法就是先查询全部数据,再对数据统计行数,再进行分页查询;
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。