select round(count(distinct a.user_id)/count(distinct t.user_id),3) from login a right join (select distinct user_id,min(date) over(partition by user_id order by date) as first_login from login)t on a.user_id = t.user_id and a.date = t.first_login+1