重新安排号码

编程入门 行业动态 更新时间:2024-10-18 23:27:25
本文介绍了重新安排号码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

大家好, 我是Jyotin. 我正在使用ms Access数据库创建基于vb Windows的项目. 我正在使用运行良好的删除查询. 但我的问题是------ 我想在删除后重新排列数据表. as-i具有slno 1,2,3,4,5,6的行. 删除1,5行后,它变为2,3,4,6. 我希望它应该是1,2,3,4,这意味着剩余的行应从1开始重新排列. 请回复.

hello everybody, i am Jyotin. i am creating a vb windows based project with ms access database. i am using delete query which is working well. but my problem is------ i want to re-arrange the datatable after deletion. as-i have rows having slno 1,2,3,4,5,6. after delting 1,5 row,it becomes 2,3,4,6. i want that it should be 1,2,3,4 means remaining rows should be re-arrange staring from 1. please reply. thanks alot.

推荐答案

好,行号必须是一个Identity列,并且必须是自动递增的.如果是这样,则不能直接更改它. 如果是行号,则在插入时由您提供,那么您可以尝试根据需要进行全部更改.但是,那么,您需要谨慎维护引用完整性(如果有). (即,引用该表的其他表也必须更改) 现在,如何为表格执行此操作: 您可以使用光标来实现. Well, the RowNumbers must be an Identity column and auto-incremental. If so, you cannot change it directly. If, it is a RowNumbers are provided by you at time of insertion then you can try to change for all as you need. But then, you need to be careful to maintain referential integrity if any. (i.e. other tables referencing it must also be changed) Now, How to do this for a table: You can use Cursors to achieve it.

更多推荐

重新安排号码

本文发布于:2023-07-14 09:59:04,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1104033.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:号码

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!