mysql查询语法错误

时间:2015-02-12 10:44:45

标签: mysql sql

我有这个mysql查询,我正在运行php,但我真的不知道它有什么不对,有人可以帮帮我吗?

SELECT OrderID, SUM(Quantity) AS Total FROM OrderDetails 
GROUP BY OrderID WHERE ProductID BETWEEN 11 AND 14;

1 个答案:

答案 0 :(得分:3)

使用以下内容: -

SELECT OrderID, SUM(Quantity) AS Total 
FROM OrderDetails 
WHERE ProductID BETWEEN 11 AND 14 
GROUP BY OrderID;