Anyone know how to create a trigger that update the table that invoked it?
I am creating a trigger that update the some table witch call it.
create table t1 (
id int, name varchar(50), c int default 0, father int,
foreign key (father) references t1(id) on update restrict on delete
create trigger tg_t1
before update on t1
for each row
update t1 set c=c+1 where father=NEW.id;
Something like it... I want to update some colums witch records are
referencing by the father record.
But when I update the mysql returns: "Can't update table 't1' in stored
function/trigger because it is already used by statement which invoked this
Why I cant make a trigger that update the some table that invoke the
How can I build it?