Musíte SUM
a poté ORDER BY
tato souhrnná hodnota:
SELECT TOP 3 ProductID, SUM(Quantity) as qSum
FROM Table
GROUP BY ProductID
ORDER BY qSum DESC
Musíte SUM
a poté ORDER BY
tato souhrnná hodnota:
SELECT TOP 3 ProductID, SUM(Quantity) as qSum
FROM Table
GROUP BY ProductID
ORDER BY qSum DESC