📌 Simple solution beating 92.16%
\nwith base as (\nSELECT distinct a2.player_id,\na1.event_date\nFROM (SELECT player_id, \n      min(event_date) as event_date \n      FROM Activity\n      GROUP
```\nwith base as (\nSELECT distinct a2.player_id,\na1.event_date\nFROM (SELECT player_id, \n      min(event_date) as event_date \n      FROM Activity\n      GROUP BY 1) a1\nLEFT JOIN Activity a2 ON a1.player_id = a2.player_id \nAND datediff(a2.event_date,a1.event_date) between 0 and 1 \nGROUP BY 1,2\nHAVING count(distinct a2.event_date) = 2\n)\n\n\nSELECT round(count(distinct b.player_id) / count(distinct a.player_id),2) AS fraction\nFROM Activity a, base b\n```\n\nSOME TRIKY POINTS:\nhere not all players who have at least 2 consecutive login dates can be counted. Only ones who have 2 consecutive login dates **since their first login dates** can be counted. That\'s why we need **min(event_date)** here :)
['MySQL']