Oracle 中实现多表关联更新多个字段

不多说,直接看实例代码,如下:

 

update student A

  set (A.name,a.dq) =

  (select B.bname,b.bdq

  from newstudent B

  where B.Bid = A.id

  and A.dq = 10

  )

  where exists (select 1

  from newstudent B

  where B.Bid = A.id

  and A.dq = 10

  );