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.
the issue with the second query is that you can't do a "max" and a "count" simultaneously. you need to chain them so that the result of count is fed to max.
max is meant to be run over a group in the table, when you get the count for each hacker_id group, max doesn't know which group to use. you should use a subquery.
check out this link: http://www.w3resource.com/sql/aggregate-functions/max-count.php
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Challenges
You are viewing a single comment's thread. Return to all comments →
the issue with the second query is that you can't do a "max" and a "count" simultaneously. you need to chain them so that the result of count is fed to max. max is meant to be run over a group in the table, when you get the count for each hacker_id group, max doesn't know which group to use. you should use a subquery. check out this link: http://www.w3resource.com/sql/aggregate-functions/max-count.php