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.
This query won't run in Oracle because ID is not subjected to an aggregation. You need to tell it how to fetch the id you want for a particular unique (power,age).
If you are using MySQL, it will allow it, but now the problem is you are not selecting the row ID with the minimum number of coins for (power,age), but rather all rows with unique (power, age) will retain their ID and populate with the minimum coins for THAT GROUP.
In other words, you are overwriting the coins for some of IDs with the minimum for that group.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Ollivander's Inventory
You are viewing a single comment's thread. Return to all comments →
This query won't run in Oracle because ID is not subjected to an aggregation. You need to tell it how to fetch the id you want for a particular unique (power,age).
If you are using MySQL, it will allow it, but now the problem is you are not selecting the row ID with the minimum number of coins for (power,age), but rather all rows with unique (power, age) will retain their ID and populate with the minimum coins for THAT GROUP. In other words, you are overwriting the coins for some of IDs with the minimum for that group.