Ollivander's Inventory

  • + 0 comments

    this worked with MS SQL but not with MySQL , can someone debug it ?

    with oli as ( select w.id, wp.age, w.coins_needed,w.power, rank() over(partition by wp.age,w.power order by w.coins_needed asc) as rnk from wands w inner join wands_property wp on wp.code =w.code where wp.is_evil = 0)

    select oli.id,oli.age,oli.coins_needed,oli.power from oli where oli.rnk = 1 order by oli.power desc , oli.age desc