You are viewing a single comment's thread. Return to all comments →
That's Weird I tested the following query on Postgresql and it's working but it doesn't work on MySQL:
SELECT h.hacker_id, h.name, COUNT(*) AS chal_count FROM hackers AS h JOIN challenges AS c ON h.hacker_id = c.hacker_id GROUP BY 1, 2 HAVING COUNT(*) = ( SELECT MAX(chal_count) FROM ( SELECT COUNT(hacker_id) AS chal_count, hacker_id FROM challenges GROUP BY 2 ) AS t1 ) OR COUNT(*) IN ( SELECT DISTINCT chal_count FROM ( SELECT chal_count, COUNT(chal_count) AS count_chal_count FROM ( SELECT COUNT(hacker_id) AS chal_count, hacker_id FROM challenges GROUP BY 2 ) AS t2 GROUP BY chal_count ) AS t3 WHERE count_chal_count = 1 ) ORDER BY 3 DESC, 1
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 →
That's Weird I tested the following query on Postgresql and it's working but it doesn't work on MySQL: