MySQL trigger: Update when reaching a certain datetime

前端 未结 2 466
花落未央
花落未央 2020-12-20 03:51

I want to create a MySQL trigger that updates a table everytime one of the datetime rows in a different table reaches a datetime lower than now.

How would I

相关标签:
2条回答
  • 2020-12-20 04:36

    You could use MySQL's Event Scheduler.

    0 讨论(0)
  • 2020-12-20 04:45

    You should be able to do it using a trigger and the event scheduler:
    - create a trigger on the table that is fired on every update / insert
    - this trigger creates a scheduled event that occurs at the datetime of the row and updates your second table

    0 讨论(0)
提交回复
热议问题