select date, round(ifnull(count(if(datediff(A.date_1,A.date) = 1,1,null))/count(if(A.num = 1,1,null)),0),3) from( select user_id, date, lead(date,1) over(partition by user_id order by date asc) as date_1, rank() over(partition by user_id order by date asc) a...