题解 | 商品销售排名

商品销售排名

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

全部评论

相关推荐

不愿透露姓名的神秘牛友
03-09 19:13
求你们别卷了的大学生...:你不骂他,我就要骂你了
今天你投了哪些公司?
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务