在 MySQL 中,我尝试定义这样的触发器:
DELIMITER $$
CREATE TRIGGER vipInvite
AFTER INSERT ON meetings
FOR EACH ROW
BEGIN
IF(NOT EXISTS (SELECT * FROM participants
WHERE meetid = NEW.meetid AND pid ='vip'))
THEN
IF(EXISTS(SELECT * FROM meetings WHERE meetid = NEW.meetid AND slot > 16))
THEN
INSERT INTO participants(meetid, pid)
VALUES (NEW.meetid,(SELECT userid
FROM people WHERE people.group = 'tap' GROUP BY invite));
END IF;
END IF;
END $$
DELIMITER ;
产生此错误:
此版本的 MySQL 尚不支持“对一个表具有相同操作时间和事件的多个触发器”。
有没有办法解决这个问题,所以我可以定义多个触发器?