题解 | 每个商品的销售总额
每个商品的销售总额
https://www.nowcoder.com/practice/6d796e885ee44a9cb599f47b16a02ea4
select a.name product_name,sum(b.quantity) total_sales, rank()over(partition by a.category order by sum(b.quantity) desc) category_rank from products a join orders b ON a.product_id=b.product_id group by a.product_id,a.name order by a.category,total_sales desc

