select user_grade,round(count(1)/(select count(distinct uid) from tb_user_log),2) as ratio from( select uid,(case when timestampdiff(day,in_time,cur_dt) < 7 then '新晋用户' when timestampdiff(day,in_time,cur_dt) >= 7 and timestampdiff(day,out_time,cur_dt) < 7 then '忠实用户' when timestampdiff(day,...