You are viewing a single comment's thread. Return to all comments →
WITH hacker_challenges AS ( SELECT hacker_id, COUNT(*) AS challenges_created FROM Challenges GROUP BY hacker_id), max_challenges AS (SELECT MAX(challenges_created) AS max_challenges FROM hacker_challenges), challenges_created_included AS (SELECT challenges_created FROM hacker_challenges group by challenges_created having count(challenges_created)=1), challenges_result AS ( SELECT hacker_id, challenges_created FROM hacker_challenges WHERE challenges_created = (SELECT * FROM max_challenges) OR challenges_created IN (SELECT * FROM challenges_created_included)) SELECT t1.hacker_id,t2.name,t1.challenges_created FROM challenges_result AS t1 JOIN hackers AS t2 on t1.hacker_id=t2.hacker_id ORDER BY t1.challenges_created DESC,t1.hacker_id;
Seems like cookies are disabled on this browser, please enable them to open this website
Challenges
You are viewing a single comment's thread. Return to all comments →