We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- SQL
- Basic Join
- Ollivander's Inventory
- Discussions
Ollivander's Inventory
Ollivander's Inventory
Sort by
recency
|
2064 Discussions
|
Please Login in order to post a comment
SELECT w1.id, w2.age, w1.coins_needed, w1.power FROM Wands AS w1 JOIN Wands_Property AS w2 ON w1.code = w2.code WHERE w2.is_evil = 0 AND w1.coins_needed = ( SELECT MIN(a.coins_needed) FROM Wands AS a JOIN Wands_Property AS b ON a.code = b.code WHERE a.power = w1.power AND b.age = w2.age ) ORDER BY w1.power DESC, w2.age DESC;
II have seen a pattern that none of the window functions are running in hackerrank. Is this issue faced by someone else?
II have seen a pattern that none of the window functions are running in hackerrank. Is this issue faced by someone else?
SELECT w.id, p.age, w.coins_needed, w.power FROM Wands w JOIN Wands_Property p ON w.code = p.code WHERE p.is_evil = 0 AND w.coins_needed = ( SELECT MIN(w1.coins_needed) FROM Wands w1 JOIN Wands_Property p1 ON w1.code = p1.code WHERE w1.power = w.power AND p1.age = p.age ) ORDER BY w.power DESC, p.age DESC;