We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Can anyone tell me why this My SQL code doesn't work?
SELECT s.hacker_id, h.name, sum(s.score)
FROM Hackers as h
INNER JOIN Submissions as s
ON h.hacker_id = s.hacker_id
WHERE s.score IN
(SELECT MAX(score)
FROM Submissions
GROUP BY hacker_id, challenge_id
ORDER BY hacker_id)
GROUP BY s.hacker_id, h.name
HAVING sum(s.score) >0
ORDER BY sum(s.score) desc, s.hacker_id asc
Cookie support is required to access HackerRank
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 →
Can anyone tell me why this My SQL code doesn't work?
SELECT s.hacker_id, h.name, sum(s.score) FROM Hackers as h INNER JOIN Submissions as s ON h.hacker_id = s.hacker_id WHERE s.score IN (SELECT MAX(score) FROM Submissions GROUP BY hacker_id, challenge_id ORDER BY hacker_id) GROUP BY s.hacker_id, h.name HAVING sum(s.score) >0 ORDER BY sum(s.score) desc, s.hacker_id asc