创建事件时无法识别的语句类型接近尾声

时间:2019-06-18 00:28:13

标签: mysql phpmyadmin innodb

当我尝试在mySQL中创建事件并键入此代码时,它会给出错误

  

无法识别的语句类型即将结束

BEGIN

            INSERT INTO orders (coinID, action, coinPrice, coinNewPrice, orderTime)
            SELECT coinID, action, coinPrice, coinNewPrice, NOW()+1 AS orderTime FROM orders
            WHERE coinID IN (SELECT id FROM coin WHERE isActive = 1 ORDER BY id ASC) AND coinID = 1 ORDER BY id DESC LIMIT 1;            

            INSERT INTO orders (coinID, action, coinPrice, coinNewPrice, orderTime)
            SELECT coinID, action, coinPrice, coinNewPrice, NOW()+2 AS orderTime FROM orders
            WHERE coinID IN (SELECT id FROM coin WHERE isActive = 1 ORDER BY id ASC) AND coinID = 2 ORDER BY id DESC LIMIT 1;            

            INSERT INTO orders (coinID, action, coinPrice, coinNewPrice, orderTime)
            SELECT coinID, action, coinPrice, coinNewPrice, NOW()+3 AS orderTime FROM orders
            WHERE coinID IN (SELECT id FROM coin WHERE isActive = 1 ORDER BY id ASC) AND coinID = 3 ORDER BY id DESC LIMIT 1;


      END

它创建事件,但不会执行查询。

0 个答案:

没有答案