题解 | #计算用户的平均次日留存率#

计算用户的平均次日留存率

https://www.nowcoder.com/practice/126083961ae0415fbde061d7ebbde453

select count( a.device_id)/count( b.device_id)
from 
(select distinct device_id,date
from 
(select
        distinct device_id,
        date as date,
        lead(date) over (partition by device_id order by date) as date2
from question_practice_detail)k
where date=date2-1 )a
right join 
(select distinct device_id,date from question_practice_detail) b
using(device_id,date)

全部评论

相关推荐

美丽的查理斯不讲武德:包kpi的啊,感觉虾皮一点hc都没有
点赞 评论 收藏
分享
点赞 收藏 评论
分享
牛客网
牛客企业服务