我有这个mysql查询,我正在运行php,但我真的不知道它有什么不对,有人可以帮帮我吗?
SELECT OrderID, SUM(Quantity) AS Total FROM OrderDetails
GROUP BY OrderID WHERE ProductID BETWEEN 11 AND 14;
答案 0 :(得分:3)
使用以下内容: -
SELECT OrderID, SUM(Quantity) AS Total
FROM OrderDetails
WHERE ProductID BETWEEN 11 AND 14
GROUP BY OrderID;