You are viewing a single comment's thread. Return to all comments →
Here's my solution in MS SQL Server:
with ranked as ( select w.id, p.age, w.coins_needed, w.power, row_number() over (partition by power, age order by coins_needed) as rn from wands w, wands_property p where w.code = p.code and p.is_evil = 0 ) select id, age, coins_needed, power from ranked where rn = 1 order by power desc, age desc;
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 →
Here's my solution in MS SQL Server: