You are viewing a single comment's thread. Return to all comments →
SQL SERVER SOLUTION
with CTE as ( select h.hacker_id,h.name,score,challenge_id from Hackers as h join Submissions as s on h.hacker_id = s.hacker_id ), CTE1 as( select MAX(score) as score,challenge_id,hacker_id from CTE group by challenge_id ,hacker_id having MAX(score) >0 ) select c.hacker_id,h.name,sum(score) from CTE1 as c join Hackers as h on c.hacker_id = h.hacker_id group by c.hacker_id, h.name order by sum(score) desc,c.hacker_id;
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 →
SQL SERVER SOLUTION