这里可能问题吧,不要在触发器里做无谓的计算。
触发器就负责把变化前的值放到T2里,要什么计算结果的话基于T2做。 ------其他解决方案-------------------- 建议不用触发器,特别是数据量很大的表。 ------其他解决方案-------------------- triggers fire when any valid event is fired, regardless of whether or not any table rows are affected
The trigger and the statement that fires it are treated as a single transaction, which can be rolled back from within the trigger. If a severe error is detected (for example, insufficient disk space), the entire transaction automatically rolls back.