MySQL创建存储过程错误
CREATEPROCEDURE'Show_Product'(INparameterINT)BEGINSELECTp.productID,productName,SUM(S...
CREATE PROCEDURE 'Show_Product'(IN parameter INT)
BEGIN
SELECT p.productID,productName,SUM(SellCount) as TotalSell,Sum(StoredCount) as TotalStored
FROM product p,product_divide pd
WHERE p.productID=pd.productid AND warehouseID=parameter
GROUP BY p.productid,productName;
END;
请问哪里不对?
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''Show_Product'(IN parameter INT) BEGIN SELECT p.productID,productName,SUM' at line 1 展开
BEGIN
SELECT p.productID,productName,SUM(SellCount) as TotalSell,Sum(StoredCount) as TotalStored
FROM product p,product_divide pd
WHERE p.productID=pd.productid AND warehouseID=parameter
GROUP BY p.productid,productName;
END;
请问哪里不对?
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''Show_Product'(IN parameter INT) BEGIN SELECT p.productID,productName,SUM' at line 1 展开
展开全部
SELECT p.productID,productName,SUM(SellCount) as TotalSell,Sum(StoredCount) as TotalStored --上面都应该指定是那张表的数据
FROM product p,product_divide pd
WHERE p.productID=pd.productid AND warehouseID=parameter--指定是那张表
GROUP BY p.productid,productName;--这个也要指定
END;
FROM product p,product_divide pd
WHERE p.productID=pd.productid AND warehouseID=parameter--指定是那张表
GROUP BY p.productid,productName;--这个也要指定
END;
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询