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

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

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

SELECT round(count(b.device_id)/count(a.device_id), 4) as avg_ret
FROM
(SELECT distinct device_id, date 
FROM question_practice_detail) as a
left join
(SELECT distinct device_id, date
FROM question_practice_detail) as b
on a.device_id = b.device_id and a.date = DATE_ADD(b.date,interval 1 day);

全部评论

相关推荐

爱看电影的杨桃allin春招:我感觉你在炫耀
点赞 评论 收藏
分享
点赞 收藏 评论
分享
牛客网
牛客企业服务