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.
anyone who could tell me why this is giving a syntax error
with cte as
(
select hacker_id, max(score) from Submissions
group by hacker_id, challenge_id
)
select h.hacker_id, h.name, sum(s.score)
from Hackers h join cte s on h.hacker_id=s.hacker_id
group by h.hacker_id, h.name
having sum(s.score)!=0
order by sum(s.score) desc ,h.hacker_id asc
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Contest Leaderboard
You are viewing a single comment's thread. Return to all comments →
anyone who could tell me why this is giving a syntax error with cte as ( select hacker_id, max(score) from Submissions group by hacker_id, challenge_id )
select h.hacker_id, h.name, sum(s.score) from Hackers h join cte s on h.hacker_id=s.hacker_id group by h.hacker_id, h.name having sum(s.score)!=0 order by sum(s.score) desc ,h.hacker_id asc