use Test
create table table1
(
id int primary key identity(1,1),
tValue nvarchar(15) not null
)
insert into table1 values('w322')
create table table2
(
id int primary key identity(1,1),
tva nvarchar(20) not null
)
insert into table2 values('55')
select * from table1
select * from table2
--更新
UPDATE table1
SET tValue=t2.tva
from table1
inner join (select table2.id,table2.tva
from table2) t2
on table1.id = t2.id
评论