创建表book的删除后触发器命令
发布网友
发布时间:2023-03-25 18:10
我来回答
共1个回答
热心网友
时间:2023-10-19 16:48
删除语句时触发:
例:删除表desk中信息时,触动触发器,向表booksheet删除数据
mysql> delimiter $
mysql> create trigger Desk2(触发器名) after delete on desk(表名) for each row
-> begin
->delete from booksheet where Phone=old.Phone and Number = old.Number and Time=old.Time and Date=old.Date and Environment=old.Environment;
->end ;$删除语句时触发:
例:删除表desk中信息时,触动触发器,向表booksheet删除数据
mysql> delimiter $
mysql> create trigger Desk2(触发器名) after delete on desk(表名) for each row
-> begin
->delete from booksheet where Phone=old.Phone and Number = old.Number and Time=old.Time and Date=old.Date and Environment=old.Environment;
->end ;$