在sqlserver和acess的delete和update语句中使用join的不同写法
节选自:佚名主页 https://www.jb51.cc/mssql/683343.html
表结构
table1(id,name) table2(id,name)
update 语句
sqlserver写法:
update table1 set table1.name = table2.name from table1 inner join table2 on table1.id = table2.id
access写法:
update table1 INNER JOIN table2 ON table1.id = table2.id
set table1.name = table2.name
delete语句
sqlserver写法:
delete table1 from table1 join table2 on table1.id = table2.id
或者
delete from table1 from table1 join table2 on table1.id = table2.id
access写法:
delete distinctRow a.* from table1 a inner join table2 on a.id = table2.id