mysql触发器语句中的别名

时间:2016-04-11 22:13:15

标签: mysql triggers alias

我正在尝试使用别名创建触发器,但是我收到错误:

delimiter |
create trigger death before insert on retiree_hist RH
for each row 
begin 
delete from myjobdata JD
where JD.emplid = RH.emplid; 
end;|
delimiter ;

我了解到别名不能使用触发器。有没有办法解决?

1 个答案:

答案 0 :(得分:1)

delimiter |
create trigger death before insert on retiree_hist
for each row 
begin 
   delete from myjobdata
   where myjobdata.emplid = NEW.emplid; 
end
|
delimiter ;