SELECT ROUND(COUNT(DISTINCT a1.player_id) / (SELECT COUNT(DISTINCT player_id) FROM Activity), 2) AS fraction
FROM Activity AS a1, Activity AS a2
WHERE a1.player_id = a2.player_id
AND DATEDIFF(a1.event_date, a2.event_date) = -1
AND (a1.player_id, a1.event_date) IN
(SELECT player_id, MIN(event_date)
FROM Activity
GROUP BY player_id)
LeetCode-SQL-550. Análisis Gameplay IV
Supongo que te gusta
Origin blog.csdn.net/m0_37302219/article/details/104964301
Recomendado
Clasificación