Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何创建触发器 MySQL 以更新员工表中的薪水并将薪水列中的旧值替换为 old_salary 列?
请参阅CREATE TRIGGER 语法:
create trigger salary_trigger before update on employee for each row begin if new.salary != old.salary then set new.old_salary = old.salary end if; end;