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

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

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

with a2 as
(with a1 as (select uid,in_time,out_time
from tb_user_log
)
select distinct a.uid,date(a.in_time) date,date(b.in_time) 2_date
from a1 a left join a1 b
on (date_add(date(a.in_time),interval 1 day) = date(b.in_time)
or date_add(date(a.in_time),interval 1 day) = date(b.out_time))
and a.uid = b.uid
where date(a.in_time) like '2021-11%')
select date,round(count(2_date)/count(date),2) uv_left_rate
from a2
where (uid,date) in 
(
with a3 as (
with a2 as(
with a1 as (select uid,in_time,out_time
from tb_user_log
)
select distinct a.uid,date(a.in_time) date,date(b.in_time) 2_date
from a1 a left join a1 b
on (date_add(date(a.in_time),interval 1 day) = date(b.in_time)
or date_add(date(a.in_time),interval 1 day) = date(b.out_time))
and a.uid = b.uid)
select *,
rank()over(partition by uid order by date) ranking 
from a2)
select uid,date from a3
where ranking = 1
and date like '2021-11%' 
)
group by date
order by date;

全部评论

相关推荐

求求要我吧:你教育经历放在下面干什么,而且27届还是28届啊()另外看你简历有两面,通常来说投递运营岗位一面简历就够了。另外个人总结要写也放在简历最下面,然后你奖项那里是2019年的哇哈哈,那你究竟投递的是社招还是实习?实习的话你是第几届是肯定要写出来的,社招的话你这个工作经历又太短太花了
点赞 评论 收藏
分享
owwhy:难,技术栈在嵌入式这块显得非常浅,并且简历有大问题。教育经历浓缩成两行就行了,写什么主修课程,说的不好听这块没人在意,自我评价删了,项目写详细点,最终简历缩成一页。相关技能怎么说呢,有点差了,还写成这么多行
投了多少份简历才上岸
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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