We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
SELECT H.hacker_id, H.name, SUM(M.max_score) AS T_score
FROM (
SELECT hacker_id, challenge_id, MAX(score) AS max_score
FROM Submissions
GROUP BY hacker_id, challenge_id
) AS M
JOIN Hackers H ON M.hacker_id = H.hacker_id
GROUP BY H.hacker_id, H.name
HAVING T_score > 0
ORDER BY T_score DESC, H.hacker_id;
Cookie support is required to access HackerRank
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 →
SELECT H.hacker_id, H.name, SUM(M.max_score) AS T_score FROM ( SELECT hacker_id, challenge_id, MAX(score) AS max_score FROM Submissions GROUP BY hacker_id, challenge_id ) AS M JOIN Hackers H ON M.hacker_id = H.hacker_id GROUP BY H.hacker_id, H.name HAVING T_score > 0 ORDER BY T_score DESC, H.hacker_id;