select dt,dau,ifnull(round(ct/dau,2),0.00) as uv_new_ratio from (select first_dt,count(uid) as ct from (select uid,min(date(in_time)) first_dt from tb_user_log group by uid) a group by first_dt ) a1 right join (select dt,ifnull(count(distinct uid),0) as dau from( select uid,date(in_time) dt ...