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.
with cte_sub as (
select hacker_id,challenge_id,max(score) as max_score
from submissions group by hacker_id,challenge_id
)
select a.hacker_id, a.name,sum(max_score) as tot_score FROM
hackers a join cte_sub b on a.hacker_id = b.hacker_id
group by a.hacker_id,a.name having sum(max_score)>0
order by tot_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 →
with cte_sub as ( select hacker_id,challenge_id,max(score) as max_score from submissions group by hacker_id,challenge_id ) select a.hacker_id, a.name,sum(max_score) as tot_score FROM hackers a join cte_sub b on a.hacker_id = b.hacker_id group by a.hacker_id,a.name having sum(max_score)>0 order by tot_score desc,a.hacker_id