1082:dense_rank()和group by结合
作者:互联网
方法一:dense_rank()结合group by一起使用
select seller_id from ( select seller_id, dense_rank() over (order by sum(price) desc) r from Sales group by seller_id ) a where r=1;
方法二:all
select seller_id from Sales group by seller_id having sum(price)>=all( select sum(price) from Sales group by seller_id);
这是一个多行子查询;all表示和子查询返回的所有值比较。
标签:dense,1082,sum,rank,seller,group,id,select 来源: https://www.cnblogs.com/hugrice/p/14941906.html