博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Upselling promotion stored procedure
阅读量:4947 次
发布时间:2019-06-11

本文共 464 字,大约阅读时间需要 1 分钟。

CREATE PROCEDURE ProductPromotion_Select@ProductID intASSELECTProductID,ProductName,SUBSTRING(Description, 1, 150) + '...'AS DescriptionFROM ProductsWHERE ProductID IN(SELECT TOP 5 details2.ProductIDFROM OrderDetails details1INNER JOIN OrderDetails details2ON details1.OrderID = details2.OrderIDWHERE details1.ProductID = @ProductIDAND details2.ProductID != @ProductIDGROUP BY details2.ProductID)

转载于:https://www.cnblogs.com/javafun/archive/2008/04/02/1133794.html

你可能感兴趣的文章