题解 | #2021年11月每天新用户的次日留存率#

2021年11月每天新用户的次日留存率

http://www.nowcoder.com/practice/1fc0e75f07434ef5ba4f1fb2aa83a450

select min_time,round(count(t2.uid)/count(t1.uid),2) as uv_left_rate
from
    (select uid,min(date(in_time)) as min_time
    from tb_user_log
    group by uid
    )as t1
left join
    (select uid,date(in_time) as dt
     from tb_user_log
     union 
     select uid,date(out_time) as dt
     from tb_user_log
    )as t2
on t1.uid=t2.uid
and datediff(t2.dt,t1.min_time)=1
where date_format(min_time,'%Y-%m')='2021-11'
group by min_time
order by min_time
全部评论

相关推荐

03-19 09:58
河海大学 Java
最喜欢春天的奇亚籽很...:同学,是小红书不是小哄书,一眼就能看到的错误
投了多少份简历才上岸
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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