mysql存储过程 “ FUNCTION line.sum does not exist.“,怎么解决?
写了一个mysql存储过程,里面用到了sql的sum函数,但是报错”FUNCTIONline.sumdoesnotexist.Checkthe'FunctionNameP...
写了一个mysql存储过程,里面用到了sql 的sum函数,但是报错”FUNCTION line.sum does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual“,怎么解决?
存储过程是这样的:
create procedure getLineStasticFreightList(in start int(4),in row int(4),in stationID varchar(4),in dateStart datetime,in dateEnd datetime)
BEGIN
DROP VIEW IF EXISTS rqusg_lineStasticFreightUser;
CREATE VIEW rqusg_lineStasticFreightUser AS
SELECT a.id, c.stationName as station,b.name as track,sum( a.dddwTime ) AS zgdddwsj, sum( a.ddzxTime ) AS zgddzxsj, sum( a.zxzyTime ) AS zgzxzysj, sum( a.ddzngyTime ) AS zgddzngysj, sum( a.hcddqsTime ) AS zgddqssj
FROM rqusg_line_yard a
......
END
// 展开
存储过程是这样的:
create procedure getLineStasticFreightList(in start int(4),in row int(4),in stationID varchar(4),in dateStart datetime,in dateEnd datetime)
BEGIN
DROP VIEW IF EXISTS rqusg_lineStasticFreightUser;
CREATE VIEW rqusg_lineStasticFreightUser AS
SELECT a.id, c.stationName as station,b.name as track,sum( a.dddwTime ) AS zgdddwsj, sum( a.ddzxTime ) AS zgddzxsj, sum( a.zxzyTime ) AS zgzxzysj, sum( a.ddzngyTime ) AS zgddzngysj, sum( a.hcddqsTime ) AS zgddqssj
FROM rqusg_line_yard a
......
END
// 展开
1个回答
推荐于2017-09-08
展开全部
哈哈, 这个情况我也遇到过。
原因估计是 SUM 后面,不能有空格的缘故……
估计 MySQL 某些版本有这个毛病。
mysql> select SUM ( sale_money ) FROM sale_report;
ERROR 1630 (42000): FUNCTION test.SUM does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual
去除空格以后:
mysql> select SUM(sale_money) FROM sale_report;
+-----------------+
| SUM(sale_money) |
+-----------------+
| 741407.00 |
+-----------------+
1 row in set (0.00 sec)
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询