You are viewing a single comment's thread. Return to all comments →
use subquery , Mysql:
SELECT t.hacker_id, t.name, SUM(mscore) AS total FROM (SELECT h.hacker_id, h.name, s.challenge_id, MAX(score) AS mscore FROM Hackers AS h JOIN Submissions AS s ON h.hacker_id = s.hacker_id GROUP BY h.hacker_id, h.name, s.challenge_id) AS t GROUP BY t.hacker_id, t.name HAVING total != 0 ORDER BY total DESC, t.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 →
use subquery , Mysql: