Upselling promotion stored procedure
CREATE PROCEDURE ProductPromotion_Select @ProductID int AS SELECT ProductID, ProductName, SUBSTRING(Description, 1, 150) + '...' AS Description FROM Products WHERE ProductID IN ( SELECT TOP 5 details2.ProductID FROM OrderDetails details1 INNER JOIN OrderDetails details2 ON details1.OrderID = details2.OrderID WHERE details1.ProductID = @ProductID AND details2.ProductID != @ProductID GROUP BY details2.ProductID )