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

找出待召回的流失用户

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

全部评论

相关推荐

04-03 18:59
吉林大学 Java
大专人陈义:别投了,我看到有人点了第二个链接投递,还没退出界面,不合适的邮件就发过来了
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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