创建触发器mysql#1064

时间:2016-07-21 10:47:08

标签: mysql if-statement triggers phpmyadmin

当我尝试执行此查询以使用Mysql

创建TRIGGER时
CREATE TRIGGER `befor_insert_VIN` BEFORE INSERT ON `vin_table`
FOR EACH ROW 
BEGIN
IF( SELECT COUNT(*) FROM `vin_table` WHERE `MODEL_CODE`= NEW.MODEL_CODE AND
`LOT`= NEW.LOT AND `VIN`= NEW.VIN >0 ) THEN BEGIN
DELETE FROM `vin_table` WHERE `LOT`= NEW.`LOT`;
END ;
END IF;
END ;

我收到了这个回复

  

MySQLarépondu:

     

1064 - Erreur desyntaxeprèsde''la la ligne 5

0 个答案:

没有答案