Top Competitors

  • + 0 comments

    select s.hacker_id, name from submissions s join hackers h on s.hacker_id = h.hacker_id join Challenges c on s.challenge_id = c.challenge_id join Difficulty d on c.difficulty_level = d.difficulty_level group by s.hacker_id, name having sum(case when s.score = d.score then 1 else 0 end)>1 order by sum(case when s.score = d.score then 1 else 0 end) desc, s.hacker_id