Contest Leaderboard

  • + 0 comments

    SQL SERVER SELECT HACKERS.HACKER_ID, HACKERS.NAME, SUM(MAX_SCORE.MAXSCORE) AS TOTALSCORE FROM ( SELECT SUBMISSIONS.HACKER_ID, SUBMISSIONS.CHALLENGE_ID, MAX(SUBMISSIONS.SCORE) AS MAXSCORE FROM SUBMISSIONS GROUP BY SUBMISSIONS.HACKER_ID, SUBMISSIONS.CHALLENGE_ID ) AS MAX_SCORE JOIN HACKERS ON HACKERS.HACKER_ID = MAX_SCORE.HACKER_ID GROUP BY HACKERS.HACKER_ID, HACKERS.NAME HAVING SUM(MAX_SCORE.MAXSCORE) <> 0 ORDER BY TOTALSCORE DESC, HACKERS.HACKER_ID ASC