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.
WITH CTE as (
SELECT s.hacker_id as hid,h.name as name,COUNT() as total from Submissions AS s
JOIN Challenges AS c ON s.challenge_id = c.challenge_id
JOIN Difficulty AS d ON c.difficulty_level = d.difficulty_level
JOIN Hackers AS h ON s.hacker_id = h.hacker_id
WHERE s.score = d.score
GROUP BY s.hacker_id,h.name
HAVING COUNT() > 1
)
SELECT hid,name FROM CTE
ORDER BY total desc,hid
Cookie support is required to access HackerRank
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 →
WITH CTE as ( SELECT s.hacker_id as hid,h.name as name,COUNT() as total from Submissions AS s JOIN Challenges AS c ON s.challenge_id = c.challenge_id JOIN Difficulty AS d ON c.difficulty_level = d.difficulty_level JOIN Hackers AS h ON s.hacker_id = h.hacker_id WHERE s.score = d.score GROUP BY s.hacker_id,h.name HAVING COUNT() > 1 )
SELECT hid,name FROM CTE ORDER BY total desc,hid