- --Task 10
- Find all items with statistics larger than average. Display only items that have Mind, Luck and Speed greater than average Items mind, luck and speed. Sort the results by item names in alphabetical order.
- i.Name, i.Price, i.MinLevel,
- s.Strength, s.Defence, s.Speed, s.Luck,s.Mind
- from Items i
- join [Statistics] s
- on i.StatisticId = s.Id
- Mind > (SELECT AVG(Mind) FROM [Statistics])
- and Luck > (SELECT AVG(Luck) FROM [Statistics])
- and Speed > (SELECT AVG(Speed) FROM [Statistics])
- order by i.Name
a guest Jul 14th, 2015 177 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
RAW Paste Data