题解 | 用户购买次数前三

用户购买次数前三

https://www.nowcoder.com/practice/e359c071d29c4fb7bac6d346f0cfe1d0


select 
uid,
cnt
from(
select
uid,
count(distinct trace_id) as cnt,
row_number()over(order by count(distinct trace_id) desc,uid) as pdiff
from user_client_log
where
step="order"
group by uid
) as t 
where
t.pdiff<=3

全部评论

相关推荐

北枳的南橘:建议大家务必去和他沟通一下,像极了小学生对你侃侃而谈国际局势😂
找AI工作可以去哪些公司...
点赞 评论 收藏
分享
02-28 13:25
已编辑
门头沟学院 Java
点赞 评论 收藏
分享
评论
1
收藏
分享

创作者周榜

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