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.
/*
Enter your query here.
Please append a semicolon ";" at the end of the query and enter your query in a single line to avoid error.
*/
select * from (
select hacker_id, name, sum(max_score) as total_score
from (
select s.hacker_id, h.name, s.challenge_id , max(s.score) as max_score
from submissions s
join hackers h
on s.hacker_id = h.hacker_id
group by s.hacker_id, h.name, s.challenge_id
--HAVING MAX(S.SCORE)>0
)
group by hacker_id, name
)
WHERE TOTAL_SCORE <>0
order by total_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 →
/* Enter your query here. Please append a semicolon ";" at the end of the query and enter your query in a single line to avoid error. */
select * from ( select hacker_id, name, sum(max_score) as total_score from ( select s.hacker_id, h.name, s.challenge_id , max(s.score) as max_score from submissions s join hackers h on s.hacker_id = h.hacker_id group by s.hacker_id, h.name, s.challenge_id --HAVING MAX(S.SCORE)>0 ) group by hacker_id, name ) WHERE TOTAL_SCORE <>0 order by total_score desc, hacker_id asc ;