-3
我一直有一個錯誤SQL服務器:語法錯誤
附近有語法錯誤關鍵字 '選擇'
錯誤syntac附近 ')'
(SELECT TOP 5 t2.ItemID, SUM(t2.Quantity)
FROM Orders as t1
as Quantity FROM t2.ItemID in
(SELECT ItemID FROM Orders as t1 INNER JOIN BasketItems as t2 on t2.BasketID = t1.BasketID
WHERE t1.OrderStatusID = 3 AND t1.OrderDate BETWEEN '" + LastWeekDate + "' AND '" + TomorrowsdaysDate + "')
GROUP BY t2.ItemID ORDER BY Quantity desc");
安置自己的BasketItems,訂單數據結構 – podiluska 2012-08-06 10:18:30