DELIMITER $$
CREATE
/*[DEFINER = { user | CURRENT_USER }]*/
TRIGGER `ir_db1407`.`after_update_ind_user` AFTER UPDATE
ON `ir_db1407`.`ind_user`
FOR EACH ROW BEGIN
SET @user_id=OLD.id
IF (NEW.STATUS = '2' OR NEW.STATUS ='3')
THEN
DELETE FROM ind_user_events WHERE user_id = @user_id;
DELETE FROM ind_user_mobile WHERE user_id = @user_id;
END IF;
END$$
DELIMITER;
错误代码:1064 您的 SQL 语法有错误;检查与您的 MySQL 服务器版本相对应的手册,以在 'if (new.status = '2' or new.status ='3') 附近使用正确的语法,然后在第 7 行从 ind_user_events wh' 中删除