How it works? Does mysql call before running INSERT only in case of insertions, or every time an insert or update occurs, if the query being executed looks like this:
INSERT INTO tSomething VALUES (...) ON DUPLICATE KEY UPDATE ......
I want to update the column value depending on other col values when inserting a row. However, I do not want this behavior for updates. The query, which will always be executed, will be as indicated above. For this, I chose INSERT AFTER. However, I cannot update col using AFTER INSERT TRIGGER as
SET NEW.score = NEW.score1 + NEW.score2;
I read somewhere that before the INSERT trigger is triggered, in this case it would be possible to trigger the triggers every time the request is executed. It's true? If so, how to solve this problem with a trigger.
source
share