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