MySQL trigger set values for NEW row and update another in the same table

后端 未结 4 1895
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-01 15:14

I have a table that I keep track of fees for a specific item. These fees can change over time so I have two columns (startDate, endDate) with the current set of fees always

4条回答
  •  独厮守ぢ
    2020-12-01 15:24

    From the MySQL Docs:

    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.

    You will need to find some other way of doing what you're trying to do.

提交回复
热议问题