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 t.hacker_id,h.name, sum(t.max_scores) from(
SELECT HACKER_ID, challenge_id,max(score) as max_scores from submissions group by HACKER_ID,challenge_id
) t
JOIN
hackers h on t.hacker_id=h.hacker_id group by t.hacker_id,h.name having sum(t.max_scores) <> 0
order by sum(t.max_scores) desc, t.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 →
My SQL
select t.hacker_id,h.name, sum(t.max_scores) from( SELECT HACKER_ID, challenge_id,max(score) as max_scores from submissions group by HACKER_ID,challenge_id ) t JOIN hackers h on t.hacker_id=h.hacker_id group by t.hacker_id,h.name having sum(t.max_scores) <> 0 order by sum(t.max_scores) desc, t.hacker_id;