select user_grade, round(count(uid)/(select count(distinct uid) from tb_user_log),2) ratio from( select uid, (CASE when DATEDIFF(td,first_reg)>6 and DATEDIFF(td,last_active)<=6 then "忠实用户" when DATEDIFF(td,first_reg)<=6 and DATEDIFF(td,last_active)<=6 then "新晋用户" when DATEDIFF(td,last_ac...