题解 | 商品销售排名
商品销售排名
https://www.nowcoder.com/practice/79c6c3d6d66946f79387bca73c0a29f4
with a as ( select t2.product_name product_name ,t2.price price ,count(*) cnt from user_client_log t1 join product_info t2 on t1.product_id = t2.product_id where t1.step = 'select' and t1.pay_method != '' group by 1,2 ) select product_name ,price*cnt total from a order by 2 desc limit 2
