我有两个表名:registeredList 和 deregisteredlist。现在,当用户从“registeredlist”表中注销时,触发器会将他的信息更新到注销表并从注册表中删除记录。在我下面的过程中,我可以正确更新它,但不能从注册表中删除用户。我的过程:
DELIMITER $$
USE `abc_db`$$
DROP TRIGGER `UnsubscriberListTrigger`$$
CREATE
TRIGGER `UnsubscriberListTrigger` AFTER UPDATE ON `registeredlist` FOR EACH ROW
BEGIN
IF (old.SubscriberStatus='registered') THEN
INSERT INTO deregisteredlist(name,SubscriberStatus,DeRegistrationDate)
VALUES(old.name,'Deregistered',NOW());
DELETE from registeredlist where old.id=new.id;/???????/I am getting problem here
END IF;
END $$
DELIMITER ;
提前致谢。