Row versioning in MySQL

前端 未结 2 1045
-上瘾入骨i
-上瘾入骨i 2021-01-03 14:10

I would like to include an integer version field in my table, auto-incrementing on each update made to a row. Is it possible to do this in MySQL?

Please note that I\

相关标签:
2条回答
  • 2021-01-03 14:36

    Yes it is. The more general problem is called slowly changing dimensions.

    0 讨论(0)
  • 2021-01-03 14:40

    The only way (I can think of) to do this is a (before-update) trigger that automatically increments the column value.

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