Bootstrap

UPDATE语句关联两个表修改数据

说明:A、B两表根据id关联,将B表指定字段值赋值给A表指定字段

UPDATE ceshi1027 A 
SET NAME = ( SELECT B.OBJ_NAME FROM ddceshi1027 B WHERE A.OBJ_ID = B.guid ) 
WHERE
	EXISTS ( SELECT 1 FROM ddceshi1027 B WHERE A.OBJ_ID = B.guid )
;