加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > MsSql教程 > 正文

在sqlserver和acess的delete和update语句中使用join的不同写法

发布时间:2020-12-12 15:18:13 所属栏目:MsSql教程 来源:网络整理
导读:表 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 = ta

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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读