You are viewing a single comment's thread. Return to all comments →
mySQL - this one was confusing to me but doing it like this seemed to make the most sense to me:
SELECT w.id, wp.age, w.coins_needed, w.power FROM Wands w JOIN Wands_Property wp ON w.code = wp.code JOIN ( SELECT wp.age, w.power, MIN(w.coins_needed) AS min_cost FROM Wands w JOIN Wands_Property wp ON w.code = wp.code WHERE wp.is_evil = 0 GROUP BY wp.age, w.power ) AS best ON wp.age = best.age AND w.power = best.power AND w.coins_needed = best.min_cost WHERE wp.is_evil = 0 ORDER BY w.power DESC, wp.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 - this one was confusing to me but doing it like this seemed to make the most sense to me: