赞
踩
贴出来一个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
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。