[Exercise] 5 Data Aggregation * Smallest Deposit Group per Magic Wand Size
Select the deposit group with the lowest average wand size.
select [DepositGroup] FROM
(SELECT w.DepositGroup AS [DepositGroup], AVG(w.MagicWandSize) AS
[LongestMagicWand]
FROM WizzardDeposits AS w
GROUP BY [DepositGroup] ) AS Result
HAVING Result.[LongestMagicWand] = min(Result.LongestMagicWand)
Така не става, някой може ли да каже как трябва да се направи?