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

找出待召回的流失用户

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

全部评论

相关推荐

Rena1ssanc...:对的,要是面评没太烂,勤更新简历等捞就行了,腾讯可以无限复活
点赞 评论 收藏
分享
不愿透露姓名的神秘牛友
07-04 18:25
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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