--记录如下: if object_id('tb') is not null drop table tb go create table tb(a float,b float) insert tb select 1.1 ,2.0 union all select 1.2 ,2.2 union all select 1.3 ,2.1 goupdate tb set A=B,B=Aselect * from tb/** a b ----------------------------------------------------- ----------------------------------------------------- 2.0 1.1000000000000001 2.2000000000000002 1.2 2.1000000000000001 1.3(所影响的行数为 3 行) */
if object_id('tb') is not null drop table tb
go
create table tb(a float,b float)
insert tb
select 1.1 ,2.0 union all
select 1.2 ,2.2 union all
select 1.3 ,2.1
goupdate tb set A=B,B=Aselect * from tb/**
a b
----------------------------------------------------- -----------------------------------------------------
2.0 1.1000000000000001
2.2000000000000002 1.2
2.1000000000000001 1.3(所影响的行数为 3 行)
*/