You are viewing a single comment's thread. Return to all comments →
My solution in mysql.
select tmp.contest_id,tmp.hacker_id,tmp.name,tmp.ss,tmp.sas,tmp1.sv,tmp1.suv from (select con.contest_id,con.hacker_id,con.name,sum(ifnull(ss.total_submissions,0)) as ss,sum(ifnull(ss.total_accepted_submissions,0)) as sas from contests con left join colleges col on con.contest_id=col.contest_id left join challenges cha on col.college_id=cha.college_id left join submission_stats ss on cha.challenge_id=ss.challenge_id group by con.contest_id) tmp left join (select con.contest_id,con.hacker_id,con.name,sum(ifnull(vs.total_views,0)) as sv,sum(ifnull(vs.total_unique_views,0)) as suv from contests con left join colleges col on con.contest_id=col.contest_id left join challenges cha on col.college_id=cha.college_id left join view_stats vs on cha.challenge_id=vs.challenge_id group by con.contest_id) tmp1 on tmp.contest_id=tmp1.contest_id where ss!=0 or sas!=0 or sv!=0 or suv!=0 order by 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 →
My solution in mysql.