student表:

 

SQL Server多表多列更新

lag表:

SQL Server多表多列更新

要求将student表stu_id列为1的stu_nick列和stu_phont列的数据更新为lag表的lag_nick列和lag_phone列.

SQL语句:

update s 
set s.stu_nick=o.lag_nick,s.stu_phone=o.lag_phone
from Student as s
join lag as o
on o.lag_id=s.stu_id
where o.lag_id=1

 

相关文章:

  • 2022-12-23
  • 2021-08-13
  • 2021-11-04
  • 2022-12-23
  • 2021-11-30
  • 2021-07-04
猜你喜欢
  • 2021-08-10
  • 2022-12-23
  • 2022-12-23
  • 2022-02-19
  • 2021-10-03
  • 2022-12-23
  • 2021-12-03
相关资源
相似解决方案