Código SQL:
Ver originalSELECT * FROM(
SELECT ROW_NUMBER() OVER (partition BY [AÑO] ORDER BY [AÑO]) AS rn, t1.* FROM(
SELECT YEAR(OrderDate) AS AÑO, ProductName, SUM(Quantity) AS VecesVendido FROM Products
INNER JOIN OrderDetails ON Products.ProductID = OrderDetails.ProductID
INNER JOIN Orders ON Orders.OrderID = OrderDetails.OrderID
GROUP BY YEAR(OrderDate), ProductName
) AS t1
) AS t2 WHERE rn<=5