Ollivander's Inventory

  • + 0 comments

    sql server: with minCoinsTable as(select w.code,wp.age, min(coins_needed) as minCoins from Wands as W inner join Wands_Property as WP on W.code = WP.code and WP.is_evil = 0 group by w.code,wp.age,w.power) select id, age, W.coins_needed, w.power from minCoinsTable as MC inner join Wands as W on MC.code = W.code and W.coins_needed=MC.minCoins order by power desc,age desc