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.
with final_body as(
SELECT f.hacker_id,f.name,sum(f.marks) as tp FROM(
select h.hacker_id,h.NAME,s.challenge_id,max(s.score)as marks from Hackers h,Submissions s
where h.hacker_id=s.hacker_id group by h.NAME,h.hacker_id,s.challenge_id order by h.hacker_id,s.challenge_id )f group by f.hacker_id,f.name
order by tp desc)
SELECT * from final_body b where b.hacker_id not in (SELECT final_body.hacker_id from final_body where final_body.tp=0) order by b.tp desc,b.hacker_id;
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 →
with final_body as( SELECT f.hacker_id,f.name,sum(f.marks) as tp FROM( select h.hacker_id,h.NAME,s.challenge_id,max(s.score)as marks from Hackers h,Submissions s where h.hacker_id=s.hacker_id group by h.NAME,h.hacker_id,s.challenge_id order by h.hacker_id,s.challenge_id )f group by f.hacker_id,f.name order by tp desc) SELECT * from final_body b where b.hacker_id not in (SELECT final_body.hacker_id from final_body where final_body.tp=0) order by b.tp desc,b.hacker_id;