50,530
社区成员
发帖
与我相关
我的任务
分享
update A set a1 = B.b2 from A inner join B on A.a1=B.b1
第一天逛论坛学到不少东西
update A set a1 = (select b2 from B where B.b1 = A.a1) where A.a1 in (select B.b1 from B )
Update A set A.a1=(select b2 from B where A.a1=B.b1)
不过这个需求有点奇怪,更新了A表中的a1字段,那么这样不就失去和B表的关联吗?
如果更新A表中的其它字段还行,如果更新的是a1感觉怪怪的