我知道这类问题列出了很多问题,我在 MySQL 中尝试了很多,但似乎没有任何效果。我希望这只是一个小错误。
DROP TRIGGER IF EXISTS AcceptMeeting;
DELIMITER $$
CREATE TRIGGER AcceptMeeting
BEFORE INSERT ON participants
FOR EACH ROW
BEGIN
IF 'vip' IN (SELECT peo.group FROM people peo WHERE userid = NEW.pid)
AND 'tap' IN (SELECT pe.group FROM participants p, people pe, meetings m
WHERE m.meetid = p.meetid)
AND p.pid = pe.userid
AND p.status = 'a'
THEN
SET NEW.status = 'a';
END IF;
END $$
DELIMITER ;
错误代码:1054。字段列表中的未知列peo.group。