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
a.hacker_id
,a.name
,sum(a.score)
from
(
select
h.hacker_id
,h.name
,s.challenge_id
,MAX(s.score) as score
from Hackers h
join Submissions s
on h.hacker_id = s.hacker_id
group by
h.hacker_id
,h.name
,s.challenge_id
) a
group by
a.hacker_id
,a.name
HAVING sum(a.score) > 1
order by sum(a.score) desc
, a.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 a.hacker_id ,a.name ,sum(a.score) from ( select h.hacker_id ,h.name ,s.challenge_id ,MAX(s.score) as score from Hackers h join Submissions s on h.hacker_id = s.hacker_id group by h.hacker_id ,h.name ,s.challenge_id ) a
group by a.hacker_id ,a.name
HAVING sum(a.score) > 1
order by sum(a.score) desc , a.hacker_id