Top Competitors

  • + 0 comments

    same question. Theoretically inner join doesn't discriminate joined table orders. But it produce wrong asnwer in this case. Here's my code. Anyone can help to shed some light on this question?

    SELECT h.hacker_id, h.name FROM Hackers h JOIN Challenges c on h.hacker_id=c.hacker_id JOIN submissions s on h.hacker_id=s.hacker_id JOIN difficulty d on d.difficulty_level= c.difficulty_level where d.score = s.score AND d.difficulty_level=c.difficulty_level GROUP BY hacker_id,h.name HAVING COUNT(s.hacker_id)>1 ORDER BY COUNT(s.hacker_id)DESC,s.hacker_id ASC;