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.
What's wrong with this code? INNER JOIN ,being commutative, should work even if the order of the join statements is altered.,Shouldn't it?
select s.hacker_id,h.name
from hackers as h
inner join challenges as c on
h.hacker_id=c.hacker_id
inner join difficulty as d on
d.difficulty_level=c.difficulty_level
inner join submissions as s on
s.challenge_id=c.challenge_id
where d.score=s.score and c.difficulty_level= group by s.hacker_id,h.name
having count(s.hacker_id)>1
order by count(s.hacker_id) desc,s.hacker_id;
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 →
What's wrong with this code? INNER JOIN ,being commutative, should work even if the order of the join statements is altered.,Shouldn't it?
select s.hacker_id,h.name from hackers as h inner join challenges as c on h.hacker_id=c.hacker_id
inner join difficulty as d on d.difficulty_level=c.difficulty_level inner join submissions as s on s.challenge_id=c.challenge_id where d.score=s.score and c.difficulty_level= group by s.hacker_id,h.name having count(s.hacker_id)>1 order by count(s.hacker_id) desc,s.hacker_id;