update a set a.at = b.mm from a,b where a.at = b.bt
update a set a.AT=b.MM from A表 a,B表 b where a.AT=b.BT
要是类型相同的话就直接update A set AT=B.MM from A join B on A.AT =B.BT
update a set a.AT = b.MM from A a,B b where a.AT = b.BT
update a set at=mm from a inner join b on a.at=b.bt
update A set AT=B.MM from B where A.AT =B.BT
if db_id('A') is not null drop table A go create table A ( [AT] char(1) not null )if db_id('B') is not null drop table B go create table B ( [BT] char(1) not null, MM char(1) not null )insert into A select '1' union select '2' union select '3' union select '4' union select '5' goinsert into B select '1','o' union select '2','u' union select '3','j' union select '4','l' union select '5','k' goupdate A set a.[AT]=b.MM from A a left join B b on a.[AT]=b.BTselect * from Adrop table A,BAT ---- o u j l k
set AT=B.MM
from a,b
where a.AT=B.BT
update a
set a.at = b.mm
from a,b
where a.at = b.bt
from A表 a,B表 b where a.AT=b.BT
update a
set a.AT = b.MM
from A a,B b
where a.AT = b.BT
set at=mm
from a inner join b
on a.at=b.bt
if db_id('A') is not null
drop table A
go
create table A
(
[AT] char(1) not null
)if db_id('B') is not null
drop table B
go
create table B
(
[BT] char(1) not null,
MM char(1) not null
)insert into A
select '1' union
select '2' union
select '3' union
select '4' union
select '5'
goinsert into B
select '1','o' union
select '2','u' union
select '3','j' union
select '4','l' union
select '5','k'
goupdate A set a.[AT]=b.MM
from A a
left join B b
on a.[AT]=b.BTselect * from Adrop table A,BAT
----
o
u
j
l
k
update 表A set AT=MM from 表B where AT=BT