You are viewing a single comment's thread. Return to all comments →
It seems your solution is still joining the two tables.
A solution without joining tables is as follows:
(SELECT age FROM Wands_Property WHERE code = w.code) AS age,
FROM Wands w
WHERE w.code IN
(SELECT code FROM Wands_Property WHERE is_evil = 0)
AND coins_needed =
(SELECT MIN(coins_needed) FROM Wands
WHERE code = w.code AND power = w.power)
ORDER BY power DESC, age DESC;
what is the use of code = w.code and power = w.power ?
why do we have to equate these same two columns?