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.
THIS CODE IS GIVING RESULT IN MY SQL WORKBench but IN hACKERRANK IT IS SHOWING ERRO, why???
with full_score as (select h.name,s.challenge_id,s.hacker_id,c.difficulty_level from challenges c
join submissions s on
c.challenge_id=s.challenge_id
join difficulty d on
c.difficulty_level=d.difficulty_level and s.score=d.score
join hackers h on
s.hacker_id=h.hacker_id),
co as (select hacker_id,row_number() over(partition by hacker_id) as cu from full_score)
select distinct(hacker_id),name from ( select v.cu, f.hacker_id,f.name from co v
join full_score f on
f.hacker_id=v.hacker_id
having v.cu > 1
order by v.cu desc,f.hacker_id)x
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 →
THIS CODE IS GIVING RESULT IN MY SQL WORKBench but IN hACKERRANK IT IS SHOWING ERRO, why???
with full_score as (select h.name,s.challenge_id,s.hacker_id,c.difficulty_level from challenges c join submissions s on c.challenge_id=s.challenge_id join difficulty d on c.difficulty_level=d.difficulty_level and s.score=d.score join hackers h on s.hacker_id=h.hacker_id), co as (select hacker_id,row_number() over(partition by hacker_id) as cu from full_score) select distinct(hacker_id),name from ( select v.cu, f.hacker_id,f.name from co v join full_score f on f.hacker_id=v.hacker_id having v.cu > 1 order by v.cu desc,f.hacker_id)x