题解 | #找出待召回的流失用户#

找出待召回的流失用户

https://www.nowcoder.com/practice/74ec0a3766bf480ab7690486943678a4

with cte as (
select uid,count(*) as times,
           count(distinct login_date) as days,
           max(login_date) as rec_date,
           max(max(login_date))over() as cur_date
from user_login_tb
group by uid )
select uid,days,times
from cte 
where (times>=4 or days>=3) and datediff(cur_date,rec_date) >29
order by days desc ,times desc

全部评论

相关推荐

专心打鱼:互联网搬运工,贴子都要偷
点赞 评论 收藏
分享
点赞 收藏 评论
分享
牛客网
牛客企业服务