如何使用ms-access查询将序列号更新到表中 [英] How to update series number in to a table using ms-access query
本文介绍了如何使用ms-access查询将序列号更新到表中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我想更新系列号(不是使用Ms访问查询将主键放入临时表中。
每次我从该表中删除记录并插入新行。
Ex: -
表
Hi All,
I want to update series number(not the primary key into a temporary table using Ms-access query.
Every time i deleted the record from that table and insert new rows.
Ex:--
Table
EmpName Desig Loc
AA Officer Hyd
Bb Mgr Ind
CC Assoc Us
DD Sr.Mgr UK
我想要系列号的表格
I want the table with series number
S.No EmpName Desig Loc
1 AA Officer Hyd
2 Bb Mgr Ind
3 CC Assoc Us
4 DD Sr.Mgr UK
喜欢这个
提前致谢
Sucharitha
Like this
Thanks in advance
Sucharitha
推荐答案
创建列 srno 数据类型 int
现在,在数据库中添加记录
create column srno with datatype int
now, while adding record in database
Insert into tbl
select
(select Isnull(max(srno),0)+1 from tbl) as srno,
'abc' as EmpName ,
'Officer' as Desig,
'Ind' as Loc
快乐编码!
:)
Happy Coding!
:)
这篇关于如何使用ms-access查询将序列号更新到表中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文