--Declare
DECLARE @ProductTotals TABLE
(
  ProductID int,
  Revenue money
)


--Populate variable
INSERT INTO @ProductTotals (ProductID, Revenue)
  SELECT ProductID, SUM(UnitPrice * Quantity)
    FROM [Order Details]
    GROUP BY ProductID