Can””t update table “”psxt_user”” in stored function/trigger because it is already used by statement which invoked this stored function/trigger.
以上是异常信息;
以上是异常信息;
create trigger user_delete before update on psxt_user for each row begin declare time int(1); select state into time from psxt_user where id = new.id; if time >= 6 then delete from psxt_user where id = new.id; end if; end$$
以上是写的触发器。
解决方案:20分
非常遗憾,MYSQL中触发器中不能对本表进行 insert ,update ,delete 操作,以免递归循环触发。