本文介绍了SQL自动编号问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的朋友们我想将数据从一张桌子复制到另一张桌子我知道我们可以使用以下查询来完成这项任务



INSERT INTO Destination

(EnrollNo,

CheckIn,

CheckOut,

DiffTime)

SELECT EnrollNo,

CheckIn,

CheckOut,

DiffTime

来源



但是这里有问题...我想添加一个新的colum,其卷号从1开始结束...我将给出一个带有autonumbreing的PK ...在第二个colum之后,自动编号没有PK但它应该从1开始运行查询结束..

提前谢谢`

Dear Friends i want to copy data from one table to another table i know we can do this task using following query

INSERT INTO Destination
(EnrollNo,
CheckIn,
CheckOut,
DiffTime)
SELECT EnrollNo,
CheckIn,
CheckOut,
DiffTime
FROM Source

but here is problem ... i want to add a new colum with roll number which is started from 1 to end ... i will give a PK with autonumbreing ... after this 2nd colum with autonumbering without PK but it should be start from 1 to end of running query ..
Thanks in advance `

推荐答案




这篇关于SQL自动编号问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 19:51