You are viewing a single comment's thread. Return to all comments →
-- MS SQL SERVER -- --hackers: a --submissions: b --cte: c with cte as( select a.hacker_id, a.name, b.challenge_id, max(b.score) as cte_score from hackers a join submissions b on a.hacker_id = b.hacker_id group by a.hacker_id, a.name, b.challenge_id ) select a.hacker_id, a.name, sum(c.cte_score) as t_score from hackers a join cte c on a.hacker_id = c.hacker_id group by a.hacker_id, a.name having sum(c.cte_score) > 0 order by t_score desc, a.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 →