You are viewing a single comment's thread. Return to all comments →
MySQL:
SELECT H.hacker_id, H.name, TS.total_score FROM Hackers H JOIN (SELECT hacker_id, SUM(max_score) AS total_score FROM (SELECT hacker_id, challenge_id, MAX(score) AS max_score FROM Submissions GROUP BY hacker_id, challenge_id) AS MaxScores GROUP BY hacker_id) AS TS ON H.hacker_id = TS.hacker_id WHERE TS.total_score > 0 ORDER BY TS.total_score DESC, H.hacker_id ASC;
Seems like cookies are disabled on this browser, please enable them to open this website
Contest Leaderboard
You are viewing a single comment's thread. Return to all comments →
MySQL: