Contest Leaderboard

  • + 0 comments
    select hacker_id,name,sum(max_score) as total_score
    from (
        select s.hacker_id,h.name,challenge_id,max(score) as max_score
    from submissions s
    left join hackers h
        on s.hacker_id=h.hacker_id
    group by s.hacker_id,h.name,challenge_id
    having max(score)>0) as max_count
    group by hacker_id,name
    order by total_score desc,hacker_id asc