34,593
社区成员
发帖
与我相关
我的任务
分享
/*
declare @table table (id int identity(1,1),col varchar(1))
insert into @table
select 5,'a' union all
select 6,'b' union all
select 9,'c'
--先取消自增列
*/
declare @table table (id int,col varchar(1))
insert into @table
select 5,'a' union all
select 6,'b' union all
select 9,'c'
declare @i int
set @i=0
update @table
set @i=id=@i+1
select * from @table
/*
id col
----------- ----
1 a
2 b
3 c
*/