查询在查询字段中运行良好并返回数据。
但是当我想把它放在存储过程上时,就会出现像给定的屏幕截图一样的错误。。
请帮帮我,我该怎么解决这个问题。
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
答案 0 :(得分:1)
试试这个。
CONTACT_ID