MS SQL Server SQL
check this code\n\nselect cast(count(distinct nxt.player_id) / (count(distinct src.player_id) * 1.0) as decimal(18,2)) as fraction\n    from (select player_id, 
check this code\n```\nselect cast(count(distinct nxt.player_id) / (count(distinct src.player_id) * 1.0) as decimal(18,2)) as fraction\n    from (select player_id, min(event_date) as event_date from Activity group by player_id) as src\nleft join Activity nxt\n       on nxt.player_id = src.player_id\n      and dateadd(day, -1, nxt.event_date) = src.event_date\n```
[]