MySQL中的插入,删除表(魔术表)

问题描述:

我是MS-SQL的常规用户,但现在正在从事以mysql作为后端的项目.

I am regular user of MS-SQL but now working on a project which has mysql as a back-end.

请告诉我,在mysql中存在这样的插入/删除表(魔术表),可以在触发器内部或常规查询中使用.

Please tell me that is there exists such a inserted/Deleted tables (Magic tables) in mysql which I can use inside trigger or in normal queries.

在MySQL中,它们分别称为NEWOLD.

They are called NEW and OLD in MySQL.

NEW是要插入的新记录或更新的数据.

NEW is the new record to be inserted or the updated data.

OLD是已删除的记录,或者是更新之前的旧数据.

OLD is the deleted record, or the old data before an update.

在此处查看用于创建触发器的文档: http://dev.mysql.com/doc/refman/5.0/en/create-trigger.html

See the documentation for creating a trigger here: http://dev.mysql.com/doc/refman/5.0/en/create-trigger.html