我需要在表 subscrubetousers 的行添加一个条件后执行触发器 INSERT :
subscrubetousers.SubscrubeToUsersType = 9
BEGIN
INSERT INTO logsub Set
LogTime = NEW.subscrubetousersTime,
LogIdNote = NEW.subscrubetousersId,
LogType = NEW.SubscrubeToUsersType;
END
答案 0 :(得分:2)
只需在触发器主体中添加一个条件:
BEGIN
IF NEW.SubscrubeToUsersType = 9 THEN
INSERT INTO logsub (LogTime,LogIdNote,LogType)
VALUES (NEW.subscrubetousersTime, NEW.subscrubetousersId,NEW.SubscrubeToUsersType);
END IF;
END