We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Anyone help on this what is issue in this ORACLE Query ,i am not getting proper answer
SELECT con.contest_id,
con.hacker_id,
con.name,
SUM(view2.total_submissions) AS total_submissions,
SUM(view2.total_accepted_submissions) AS total_accepted_submissions,
SUM(view1.total_views) AS total_views,
SUM(view1.total_unique_views) AS total_unique_views
FROM contests con
INNER JOIN colleges c ON con.contest_id = c.contest_id
INNER JOIN challenges ch ON c.college_id = ch.college_id
INNER JOIN view_stats view1 ON ch.challenge_id = view1.challenge_id
INNER JOIN submission_stats view2 ON ch.challenge_id = view2.challenge_id
GROUP BY con.contest_id, con.hacker_id, con.name
HAVING SUM(view2.total_submissions) > 0
OR SUM(view2.total_accepted_submissions) > 0
OR SUM(view1.total_views) > 0
OR SUM(view1.total_unique_views) > 0
ORDER BY con.contest_id;
Cookie support is required to access HackerRank
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 →
Anyone help on this what is issue in this ORACLE Query ,i am not getting proper answer SELECT con.contest_id, con.hacker_id, con.name, SUM(view2.total_submissions) AS total_submissions, SUM(view2.total_accepted_submissions) AS total_accepted_submissions, SUM(view1.total_views) AS total_views, SUM(view1.total_unique_views) AS total_unique_views FROM contests con INNER JOIN colleges c ON con.contest_id = c.contest_id INNER JOIN challenges ch ON c.college_id = ch.college_id INNER JOIN view_stats view1 ON ch.challenge_id = view1.challenge_id INNER JOIN submission_stats view2 ON ch.challenge_id = view2.challenge_id GROUP BY con.contest_id, con.hacker_id, con.name HAVING SUM(view2.total_submissions) > 0 OR SUM(view2.total_accepted_submissions) > 0 OR SUM(view1.total_views) > 0 OR SUM(view1.total_unique_views) > 0 ORDER BY con.contest_id;