You are viewing a single comment's thread. Return to all comments →
SELECT A.contest_id, A.hacker_id, A.Name, SUM(total_submissions) As total_submissions, SUM(total_accepted_submissions) AS total_accepted_submissions, SUM(total_views) AS total_views, SUM(total_unique_views) AS total_unique_views FROM Contests AS A LEFT JOIN Colleges AS B ON A.contest_id = B.contest_id LEFT JOIN Challenges AS C ON B.college_id = C.college_id LEFT JOIN (SELECT challenge_id, SUM(total_views) AS total_views, SUM(total_unique_views) AS total_unique_views FROM View_Stats GROUP BY challenge_id) AS D ON C.challenge_id = D.challenge_id LEFT JOIN (SELECT challenge_id, SUM(total_submissions) AS total_submissions, SUM(total_accepted_submissions) AS total_accepted_submissions FROM Submission_Stats GROUP BY challenge_id) AS E ON C.challenge_id = E.challenge_id GROUP BY A.contest_id, A.hacker_id, A.Name HAVING (total_submissions + total_accepted_submissions + total_views + total_unique_views) > 0 ORDER BY A.contest_id ;
Seems like cookies are disabled on this browser, please enable them to open this website
Interviews
You are viewing a single comment's thread. Return to all comments →