with data as ( select uid, min(in_time) time, max(out_time) last_login from tb_user_log group by uid ), data2 as ( select *, case when timestampdiff(day,time,(select max(out_time) from tb_user_log ))<7 then "新晋用户" when timestampdiff(day,last_login,(select max(out_time) f...