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

找出待召回的流失用户

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

全部评论

相关推荐

迷茫的大四🐶:你这个拿去投央国企吧,投私企包过不了的
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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