让mysql在连续范围内重新分配id
我在 mysql 中有一个现有的数据库。我的一张表的 id 不连续。我想修改表的 id,使它们从 1 变为 行数。
这个特定的表碰巧没有传入引用,因此可以更改 id,而无需修改其他表。
我想这样做的原因是我想用我正在编写的工具处理数据,如果 ids 是连续的,那么很多事情都会更简单。
I have an existing database in mysql. One of my tables has discontinuous ids. I would like to modify the ids of the table so that they go from 1 to num-of-rows.
This particular tables does not happen to have incoming references, so the ids can be changed without modifying other tables.
The reason I want to do that is that I want to process the data with a tool I am writing and if the ids are continuous then many things will be simpler.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)