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

select round(count(distinct a.user_id)/count(distinct t.user_id),3)
from login a right join
(select distinct user_id,min(date) over(partition by user_id order by date) as first_login
from login)t
on a.user_id = t.user_id and a.date = t.first_login+1

全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务