Coding Test

Leetcode - 550. Game Play Analysis IV

Indo Yoon

문제

Loading...
Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview.

정답

SELECT ROUND(COUNT(A2.player_id)/COUNT(A1.player_id),2) AS fraction
FROM (SELECT player_id, MIN(event_date) AS first_login FROM Activity GROUP BY player_id) AS A1
LEFT JOIN Activity AS A2
ON A1.player_id = A2.player_id AND A1.first_login +1 = A2.event_date