sql语句联表更新(从一个数据库中的一张表更新到另一个数据库的另一张表)

2023-05-13,,

一、sql server数据库写法:

update a set a.ksgmm=b.ksgmm,a.ksgm=b.ksgm,a.scztm=b.scztm,a.sczt=b.sczt from landsde.sde.jszb a,kyqcldb.dbo.kcl_ksjj b
where a.nd=b.nd and a.kqbh=b.kqbh and a.djflbh =b.djflbh

其中landsde.sde.jszb、kyqcldb.dbo.kcl_ksjj是不同数据库下的不同数据表

二、oracle写法

update usertab a set (a.name, a.age)= (select b.name, b.age from member b where a.id=b.id)

sql语句联表更新(从一个数据库中的一张表更新到另一个数据库的另一张表)的相关教程结束。

《sql语句联表更新(从一个数据库中的一张表更新到另一个数据库的另一张表).doc》

下载本文的Word格式文档,以方便收藏与打印。