oracle 如何在group by 的语句中使用rownum,实现分页

前端之家收集整理的这篇文章主要介绍了oracle 如何在group by 的语句中使用rownum,实现分页前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

贴出来一个demo供大家参考

SELECT rownum,a.* from( select shopid as shopId,shopname as shopName,sum(orderqty) as orderNum from pmadw.dm_order_info where orderdate >= to_date('2016-05-06','yyyy-MM-dd') and orderdate <= to_date('2016-05-13','yyyy-MM-dd') GROUP BY shopId,shopName ORDER BY SHOPID ) a where rownum < 11

原文链接:https://www.f2er.com/oracle/213884.html

猜你在找的Oracle相关文章