mysql编写触发器报错
mysql编写触发器报错触发器创建代码/* 触发器 */CREATE TRIGGER chufaqi BEFORE INSERTON `customer`FOR EACH ROWBEGIN/*INSERT INTO test(`name`,account,pwd,money) SELECT c.`name`,c.`account`,c.`pwd`,c.`money` FROM customer A
·
mysql编写触发器报错
触发器创建代码
/* 触发器 */
CREATE TRIGGER chufaqi BEFORE INSERT
ON `customer`
FOR EACH ROW
BEGIN
/*INSERT INTO test(`name`,account,pwd,money) SELECT c.`name`,c.`account`,c.`pwd`,c.`money` FROM customer AS c ORDER BY id DESC LIMIT 1;*/
INSERT INTO test VALUES (NULL,"111","111","111",123.0);
END;
报错:
错误代码: 1064
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 7
解决:
BEGIN 后面加上; BEGIN;
更多推荐
已为社区贡献2条内容
所有评论(0)