mssql中合并和连接的区别

时间:2016-04-19 14:20:55

标签: sql-server merge inner-join

我想用t2中的数据更新表t1。我可以用两种方式做。你能告诉我在准确性和性能方面的差异吗?

1

merge into t1 using t2 on t1.id = t2.id and t1.name <> t2.name
when matched then update set t1.name=t2.name

2

 update t1 set t1.name=t2.name from t1, 
 inner join t2 on t1.id = t2.id 
 where t1.name <> t2.name

0 个答案:

没有答案