2

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'm not talking about a TIMESTAMP, which is not reliable as two concurrent updates might happen during the same second.

4

2 回答 2

3

是的。更普遍的问题称为缓慢变化的维度

于 2011-06-09T10:47:36.613 回答
2

这样做的唯一方法(我能想到的)是一个(更新前)触发器,它会自动增加列值。

于 2011-06-09T11:24:32.783 回答