1.某一条条记录(ID=0)
Update TableName  set A=(select B from TableName  where ID=0) where ID=0

2.所有记录
declare @a varchar(50),@b varchar(50) ,@c varchar(50),@id int
declare pcd_cursor cursor for
select A,B,C,ID from TableName  
open pcd_cursor
fetch next from pcd_cursor    into @a ,@b,@c,@id
while(@@fetch_status=0)
begin  
        update TableName  set  A=@b where id=@id     
        FETCH NEXT FROM pcd_cursor  into @a ,@b,@c ,@id
end
close pcd_cursor
deallocate pcd_cursor


 

相关文章:

  • 2022-12-23
  • 2021-12-04
  • 2021-09-14
  • 2020-07-30
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-06-18
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-27
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案