You are viewing a single comment's thread. Return to all comments →
Oracle SQL with CTE
WITH table_1 AS ( SELECT hacker_id, challenge_id, MAX(score) AS max_scores FROM submissions WHERE score != 0 GROUP BY hacker_id, challenge_id ) SELECT h.hacker_id, h.name, SUM(table_1.max_scores) AS total_score FROM table_1 JOIN hackers h ON table_1.hacker_id = h.hacker_id GROUP BY h.hacker_id, h.name ORDER BY sum(table_1.max_scores) desc , h.hacker_id asc;
Seems like cookies are disabled on this browser, please enable them to open this website
Contest Leaderboard
You are viewing a single comment's thread. Return to all comments →
Oracle SQL with CTE