我有一个问题,使存储的MySQL函数。首先,我试图使它很容易按照官方教程:http://dev.mysql.com/doc/refman/5.0/en/create-procedure.html我的mysql函数不起作用?
create function bestalldavaror_7()
RETURNS int DETERMINISTIC
RETURN select sum(mangd) from bestalln where artikel_id = 7;
的选择查询工作只是由本身和“mangd”罚款是一个int(11)值(因此是一切都在该表) 。那么,为什么这产生一个错误:
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 'select sum(mangd) from bestalln where artikel_id = 7' at line 3
你可以发布你的表结构吗? – Tom