select n1, round(n2/ t1, 2) as ratio from ( select case when timestampdiff(day, date(t1.d1), '2021-11-04') <= 6 then '新晋用户' when timestampdiff(day, date(t2.d1), '2021-11-04') >= 29 then '流失用户' when timestampdiff(day, date(t1.d1), '2021-11-04') > 6 and timestampdiff(day, date(t2.d1), '2021-...