题解 | #找出待召回的流失用户#
找出待召回的流失用户
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