摘要:
1.自增列通用:select id=(select count(1) from table b where b.sid<a.sid) ,* from table a;select id=identity(int,1,1),* from ...第二个已经有主键自增列的就不可以用了还有就是rownumber2. CREATE TABLE dbo.#testTab ( Id int NOT NULL ) 添加数据: insert into #testTab values(3); insert into #testTab values(4); insert into #testTab valu. 阅读全文