select * from (
select a.*,rownum rn from (
select c1,c2,count(*) over() total from table where ....
) a where rownum <= 结束条数
) where rn >= 开始条数
oracle 分页的另一种写法,将总条数作为列返回
该SQL语句用于从table表中进行分页查询,首先对c1和c2列进行选择,并计算总记录数,然后通过rownum限制返回的行数,实现从开始条数到结束条数的筛选。
549

被折叠的 条评论
为什么被折叠?



