mysql用一个表更新另一个表

写法:


UPDATE Document,
ObservationRequest
SET Document.CreateOrganizationName = ObservationRequest.OrganizationName
WHERE
Document.BusinessID = ObservationRequest.ObservationUID;

 

验证:

 

SELECT
o.ServiceSectID,
d.Modality
FROM
ObservationRequest o
INNER JOIN Document d ON o.ObservationUID = d.BusinessID
WHERE o.ObservationUID <> d.BusinessID;

posted @ 2017-11-07 17:35  洛晨随风  阅读(243)  评论(0编辑  收藏  举报