select dt, round(count(t) / count(1), 2) as uv_left_rate
from (select uid, min(date(in_time)) as dt
      from tb_user_log
      group by uid) a
         left join (select uid, date(in_time) as t
                    from tb_user_log
                    union
                    select uid, date(out_time) as t
                    from tb_user_log) b on a.uid = b.uid and date_sub(t, interval 1 day) = dt
where year(dt) = 2021 and month(dt) = 11
group by dt
order by dt;