[HackerRank] Contest Leaderboard
[문제] [MySQL]SELECT hacker_id, name, SUM(score) AS total_scoreFROM (SELECT h.hacker_id, h.name, s.challenge_id, MAX(s.score) AS score FROM Hackers AS h LEFT JOIN Submissions AS s ON h.hacker_id = s.hacker_id GROUP BY h.hacker_id, h.name, s.challenge_id) AS high_scoreGROUP BY hacker_id, nameHAVING SUM(score) != 0ORDER BY total_score DESC, hacker_id ASC