select round(count( CASE WHEN datediff(date, nd) = 1 THEN 1 ELSE NULL END) / count(distinct user_id),3) from (select distinct user_id, date, min(date) over(partition by user_id) as nd from login) l