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
sub.hacker_id,
h.name,
sum(sub.MaxScore) as totalScore
from
(
select hacker_id, challenge_id, max(score) as MaxScore
from submissions
group by hacker_id, challenge_id
) as sub
join hackers h
on sub.hacker_id = h.hacker_id
group by sub.hacker_id, h.name
Having totalScore > 0
order by totalScore DESC, sub.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 →
MYSQL:
select sub.hacker_id, h.name, sum(sub.MaxScore) as totalScore from ( select hacker_id, challenge_id, max(score) as MaxScore from submissions group by hacker_id, challenge_id ) as sub join hackers h on sub.hacker_id = h.hacker_id group by sub.hacker_id, h.name Having totalScore > 0 order by totalScore DESC, sub.hacker_id