题解 | #每个商品的销售总额#
每个商品的销售总额
https://www.nowcoder.com/practice/6d796e885ee44a9cb599f47b16a02ea4
select name product_name ,sum(quantity) total_sales ,rank() over(partition by category order by sum(quantity) desc) category_rank #商品在所述类别中内部进行排名 from orders o join products p on o.product_id=p.product_id group by o.product_id order by category;