Ollivander's Inventory

  • + 1 comment

    Can you (or someone else) help me?

    I understand the question i.e for each combination of age and power you need to find the wand with minimum cost that is not evil.

    I came up with this:

    SELECT MIN(w.coins_needed),w.power,wp.age from wands w inner join wands_property wp on w.code= wp.code where wp.is_evil=0 group by w.power,wp.age order by w.power desc, wp.age desc;

    The solution requires me to add ID of the wand and I am struggling with the same. Any Idea how to get the ID infront of my solution