Top Competitors

  • + 0 comments

    what is wrong in mine?

    with cte as ( select sub.submission_id as submission_id, sub.hacker_id as hacker_id, hack.name as name, sub.challenge_id as challenge_id, diff.difficulty_level as difficulty_level, sub.score as score_gain, diff.score as total_score

     from Submissions sub 
    left join Hackers hack on hack.hacker_id = sub.hacker_id 
    left join Challenges chal on chal.challenge_id = sub.challenge_id
    left join Difficulty diff on diff.difficulty_level = chal.difficulty_level
    

    ) select hacker_id,name from cte

    where score_gain=total_score group by hacker_id having count(challenge_id)>1 order by count(challenge_id) desc,name asc