Sql server with as update用法
create table t1
( id int,[names] varchar(100))
create table t2
( id int,[names] varchar(100))
insert into t1 values(1,'t1');
insert into t1 values(2,'t2');
insert into t1 values(3,'t3');
insert into t2 values(1,'ttt1');
with temp(id,names) as
(
select id,names from t1
)
Merge into temp as a
Using t2 as b on a.id=b.id
when MATCHED THEN
Update SET a.names = b.names;
微软BI技术交流群:316744959
武汉NET技术群:961108969
NET技术群:21386099
本人具有丰富的系统开发经验,承接系统开发,小程序,NET系统开发,BI开发,有需求联系微信手机:15010195887