Du skal SUM
og derefter ORDER BY
denne oversigtsværdi:
SELECT TOP 3 ProductID, SUM(Quantity) as qSum
FROM Table
GROUP BY ProductID
ORDER BY qSum DESC
Du skal SUM
og derefter ORDER BY
denne oversigtsværdi:
SELECT TOP 3 ProductID, SUM(Quantity) as qSum
FROM Table
GROUP BY ProductID
ORDER BY qSum DESC