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
hacker_id,
NAME,
SUM(score)
FROM
(SELECT
h.hacker_id,
h.name,
s.challenge_id,
MAX(s.score) AS score
FROM
hackers h,
submissions s
WHERE h.hacker_id = s.hacker_id
GROUP BY h.hacker_id,
NAME,
s.challenge_id) X
GROUP BY hacker_id,
NAME
HAVING SUM(score) > 0
ORDER BY SUM(score) DESC,
hacker_id ASC ;
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 hacker_id, NAME, SUM(score) FROM (SELECT h.hacker_id, h.name, s.challenge_id, MAX(s.score) AS score FROM hackers h, submissions s WHERE h.hacker_id = s.hacker_id GROUP BY h.hacker_id, NAME, s.challenge_id) X GROUP BY hacker_id, NAME HAVING SUM(score) > 0 ORDER BY SUM(score) DESC, hacker_id ASC ;