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

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

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

with temp
as (
    select device_id,date from question_practice_detail
    group by 1,2
)

select count(b.device_id)/count(a.device_id) as avg_ret
from 
temp a left join temp b
on a.device_id = b.device_id
and a.date = date_sub(b.date,interval 1 day)

全部评论

相关推荐

野猪不是猪🐗:我assume that你must技术aspect是solid的,temperament也挺good的,however面试不太serious,generally会feel style上不够sharp
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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