题解 | #牛客每个人最近的登录日期(四)#

牛客每个人最近的登录日期(四)

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

select 
  t1.date as 'date', 
  count(t2.user_id) as 'new'
from (select distinct date from login ) as t1
left join (select user_id, min(date) as 'first_date' from login group by user_id) as t2
on t1.date = t2.first_date
group by t1.date
order by t1.date asc;

全部评论

相关推荐

2025-12-06 16:17
济宁学院 Java
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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