Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
456 B
1
Indexable
Never
SELECT Hackers.hacker_id, name FROM Hackers join (
    SELECT Submissions.hacker_id, count(*) AS count FROM Submissions JOIN Challenges ON Submissions.challenge_id= Challenges.challenge_id JOIN Difficulty ON Difficulty.difficulty_level=Challenges.difficulty_level
    WHERE Difficulty.score = Submissions.score 
    GROUP BY Submissions.hacker_id
    HAVING count(*)>1
) label ON Hackers.hacker_id = label.hacker_id ORDER BY count DESC, hacker_id ASC;