select dt, count(*) as dau, round(sum(if (dt = new_time, 1, 0))/count(*),2) as uv_new_ratio from (##求每个用户的活跃日期和注册日期 select uid, dt, min(dt) over ( partition by uid ) as new_time from ...