贴出来一个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