update 更新表 set 字段 = (select 参考数据 from 参考表 where  参考表.id = 更新表.id);

update table_2 m  set m.column = (select column from table_1 mp where mp.id= m.id);

例如: update person p set p.login_account_id=(select ID from user u where p.person_code=u.LOGIN_NAME and p.person_code='4500');

方法二:

  update table_1 t1,table_2 t2 set t1.column = t2.column where t1.id = t2.pid;

 

自己做的例子:

update person p set p.login_account_id=(select ID from user u where p.person_code=u.LOGIN_NAME and p.person_code='4500');

  

相关文章:

  • 2021-07-25
  • 2021-10-20
  • 2022-12-23
  • 2021-11-08
  • 2022-12-23
  • 2022-12-23
  • 2021-10-20
  • 2021-06-23
猜你喜欢
  • 2022-12-23
  • 2021-07-28
  • 2021-10-20
  • 2022-01-13
  • 2021-09-05
  • 2022-12-23
相关资源
相似解决方案