DELIMITER $$
CREATE TRIGGER player_fide ON Player AFTER UPDATE AS
BEGIN
INSERT INTO player_backup(PlayerName, OldFIDERating, NewFIDERating, Date);
Select deleted.PlayerNamer, deleted.OldFIDERating, inserted.NewFIDERating, getDate();
FROM deleted, inserted;
END;
DELIMITER ;
嗨,大家好,
为数据库创建了此触发器,但似乎在MySQL / PHPMyAdmin中运行不正常。建议检查INSERT INTO player_backup周围的语法时出错。
基本上应用一个简单的触发器,该触发器将更新玩家姓名的列,并插入玩家姓名以及他们的旧FIDERating和他们的新FIDERating以及更改的日期。所以备份表包含四列PlayerName,OLDFIDERating,NEWFIDERating,Date。
希望有人知道解决方案。谢谢感谢