You are viewing a single comment's thread. Return to all comments →
MySQL
SELECT w.id, cheapest_wands.age, cheapest_wands.coins_needed, cheapest_wands.power FROM Wands w JOIN Wands_Property wp ON w.code = wp.code JOIN (SELECT wp.age, w.power, MIN(w.coins_needed) as coins_needed FROM Wands w JOIN Wands_Property wp ON w.code = wp.code WHERE wp.is_evil = 0 GROUP BY wp.age, w.power) AS cheapest_wands ON wp.age = cheapest_wands.age AND w.coins_needed = cheapest_wands.coins_needed AND w.power = cheapest_wands.power ORDER BY cheapest_wands.power DESC, cheapest_wands.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 →
MySQL