我在phpmyadmin中使用控制台有一个事件,我希望使用rowcount()添加已更新/插入的行数等。
这是查询
REPLACE INTO `request_summary`
SELECT DATE(`Resolution_Date_Time`) as 'TicketDate',
COUNT(`Ticket_Number`) as 'TicketsClosed',
SUM(Case WHEN `SLA_Met` ='No' then 1 else 0 END) as 'FailedSLA',
SUM(Case WHEN `Call_Detail` = 'REQ-IDM-JOINER' then 1 else 0 END) as 'Joiners',
SUM(Case WHEN `Call_Detail` = 'REQ-IDM-LEAVER' then 1 else 0 END) as 'Leavers',
SUM(Case WHEN `ReOpened` = 'Yes' then 1 else 0 END) as 'Reopened'
FROM `ticket_data`
WHERE `Resolving_Group` LIKE 'MCO-TechServ%'
and date(`Resolution_Date_Time`) > '2015-01-01'
and `Call_Type` = 'Request'
and (`Logged_Via` = 'RequestIT' or `Logged_Via` = 'IDM')
and `Call_Detail` NOT LIKE '%REQ-UA%'
and `Call_Detail` NOT LIKE '%RQ-UA%'
and `Resolution_Code` != 'REQUEST REJECTED'
Group by Date(`Resolution_Date_Time`);
INSERT INTO `import_log` (`Action`, `Records inserted`)
VALUES ('RequestSummary', ROW_COUNT());
当我从phpmyadmin控制台上的SQL页面将其作为查询运行时,它运行正常并填充import_log表。但是,当我尝试将其添加为schedueled Event时,它会错误地显示
MySQL说:#1064 - 你的SQL语法有错误;检查 手册,对应右边的MySQL服务器版本 在'INSERT INTO
import_log
(Action
,Records inserted
)值附近使用的语法(第24行'RequestSummary''
有什么想法吗?