MySQL – Trigger for updating same table after insert
It seems that you can’t do all this in a trigger. According to the documentation: Within a stored function or trigger, it is not permitted to modify a table that is already being used (for reading or writing) by the statement that invoked the function or trigger. According to this answer, it seems that you … Read more