题解 | #日活与每日次日留存率#

日活与每日次日留存率

https://www.nowcoder.com/practice/18b168ada98d4bdb9108444443cea7d3

select visit_date,
count(id) as dau,
count(q1) / count(id) as next_day_per
from (
    select t1.id,t1.visit_date,t2.visit_date as q1
    from user_visit_log as t1
    left join user_visit_log as t2
    on t1.id = t2.id and datediff(t2.visit_date,t1.visit_date) = 1
) as temp
group by visit_date;

全部评论

相关推荐

03-16 11:07
南开大学 Java
牛马人的牛马人生:快手卡实习经历的
点赞 评论 收藏
分享
评论
5
收藏
分享

创作者周榜

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