更新时自动增加表字段
我正在更新单个表的多行。 我希望表字段之一在更新时自动递增。 有什么帮助吗?
我正在使用 Postgresql。 提前致谢。
I am updating a more than one row of a single table.
I want one of the table field to be auto incremented while updating.
Any help?
I am using Postgresql.
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以设置触发器并处理 UPDATE 操作并增加您想要的任何字段。
http://www.postgresql.org/docs/9.1/static/plpgsql -trigger.html
You can set a trigger and handle UPDATE operations and increase any field you want there.
http://www.postgresql.org/docs/9.1/static/plpgsql-trigger.html