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

找出待召回的流失用户

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

select uid,days,times from
(select
    uid,
    count(distinct login_date) as days,
    count(1) as times,
    date_add(max(login_date), interval 30 day) as lastday,
    (select max(login_date) from user_login_tb) as maxday
from
    user_login_tb
group by
    uid
having
    days >= 3
    or times >= 4
) t
where maxday>=lastday
order by days desc,times desc

全部评论

相关推荐

11-01 08:48
门头沟学院 C++
伤心的候选人在吵架:佬你不要的,能不能拿户口本证明过户给我。。球球了
点赞 评论 收藏
分享
可可可可可_:nb啊,看样子是专科玩了几年随便专升本了个民办,又玩了两年。你这能找到我吃
点赞 评论 收藏
分享
评论
点赞
收藏
分享
牛客网
牛客企业服务