开发者

Row versioning in MySQL

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.


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


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜