Contest Leaderboard

  • + 0 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;