mysql 创建触发器
mysql 创建触发器,好久没看望触发器了
delimiter $$
create trigger tgr_userinfo_update before update on userinfo
for each row
begin
if new.income < old.income then
insert into userinfo_err
select old.userid,old.income,new.income,user(),now();
set new.income = old.income;
end if;
end;
$$
delimiter ;