1

我收到以下错误

1064 - 您的 SQL 语法有错误;检查与您的 MySQL 服务器版本相对应的手册,以在第 2 行的“作为 BEGIN SELECT count(CustomerFeed.overall) as sat FROM ContactCenter L”附近使用正确的语法

当我运行此语句时。

DELIMITER //
CREATE PROCEDURE GetAllProducts2(IN location VARCHAR(100),
                                 IN start1   TIMESTAMP,
                                 IN end1     TIMESTAMP)
BEGIN
  SELECT count(CustomerFeed.overall) AS sat
  FROM   ContactCenter
         LEFT JOIN CustomerFeed
           ON ContactCenter.callId = CustomerFeed.callId
  WHERE  date(ContactCenter.callClose) BETWEEN start1 AND end1
         AND ContactCenter.callStatus = 'Close'
         AND CustomerFeed.overall IN ( 1, 2 )
         AND ContactCenter.location = location
         AND ContactCenter.gNum != '';
       END //
DELIMITER;
4

1 回答 1

0

不要在 MySql的存储过程定义AS中使用关键字。所以删除它。

DELIMITER //
CREATE PROCEDURE GetAllProducts2(IN location varchar(100),
                                 IN start timestamp,
                                 IN end timestamp)
BEGIN
   ...
END //
DELIMITER ;
于 2013-08-02T07:38:01.600 回答