Reputation: 1
This is a trigger:
create trigger tg1
after insert on table1
for each row
begin
update table2 set amount=if(isnull(amount),0,amount)+1 where t2_id=new.t1_id;
end;
how to optimize : amount=if(isnull(amount),0,amount)+1
thanks
Upvotes: 0
Views: 50