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

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

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

select min_time,round(count(dt)/count(min_time),2) uv_left_rate
from (
select uid,min(date(in_time)) min_time
from tb_user_log
group by uid) t1 # 新用户表
left join(
select uid,date(in_time) dt
from tb_user_log
union
select uid,date(out_time) dt
from tb_user_log  ) t2 #活跃用户表
on t2.uid = t1.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

全部评论

相关推荐

不亏是提前批,神仙打架,鼠鼠不配了
站队站对牛:现在92都报工艺岗了
投递韶音科技等公司7个岗位
点赞 评论 收藏
分享
嵐jlu:我是山川🐔里🐔🧱的,阿里系简历全过; 你这简历一看就还是半成品啊,没有荣誉经历奖项什么的吗?
投递阿里巴巴集团等公司8个岗位
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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