You are viewing a single comment's thread. Return to all comments →
/* MSSQL */ with cte as ( select s.hacker_id, h.name, s.challenge_id, s.score, row_number() over(partition by s.hacker_id, s.challenge_id order by s.score desc) as rn from submissions s join hackers h on s.hacker_id = h.hacker_id ) select hacker_id, name, sum(score) as total_score from cte where rn = 1 group by hacker_id, name having sum(score) > 0 order by total_score desc, hacker_id asc
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 →