当我单击保存按钮以保存存储过程时,它在mysql中发生错误

时间:2017-10-16 06:58:59

标签: mysql stored-procedures aggregate-functions

查询在查询字段中运行良好并返回数据。
但是当我想把它放在存储过程上时,就会出现像给定的屏幕截图一样的错误。error reporting image
请帮帮我,我该怎么解决这个问题。

CREATE DEFINER=`mikrof`@`%` PROCEDURE `savingRelated`()
LANGUAGE SQL
NOT DETERMINISTIC
CONTAINS SQL
SQL SECURITY DEFINER
COMMENT ''
BEGIN
SELECT SUM(IF(`created_at` < '2017-09-30', 1, 0)) AS MembersInLastMonth,
     SUM(IF(`created_at` between '2017-10-01'AND '2017-10-15', 1, 0)) AS MembersInCurrentMonth,
     SUM(IF(`created_at` <= '2017-10-30', 1, 0)) AS gg,
     SUM(IF(((`IsActive`=0) && (`created_at` between '2017-10-01'AND '2017-10-15')), 1, 0)) AS MembersCancelInCurrentMonth FROM members
END

1 个答案:

答案 0 :(得分:1)

试试这个。

CONTACT_ID