You are viewing a single comment's thread. Return to all comments →
SELECT cte.hacker_id, cte.name FROM ( SELECT h.hacker_id, h.name, COUNT(s.challenge_id) AS total_ch FROM Hackers h JOIN Submissions s ON h.hacker_id = s.hacker_id LEFT JOIN Challenges c ON s.challenge_id = c.challenge_id JOIN Difficulty d ON c.difficulty_level = d.difficulty_level AND s.score = d.score GROUP BY h.hacker_id, h.name ORDER BY total_ch DESC, h.hacker_id ASC) AS cte WHERE cte.total_ch > 1
Seems like cookies are disabled on this browser, please enable them to open this website
Top Competitors
You are viewing a single comment's thread. Return to all comments →