A表 TYS_XM_RELATION2019
B表 TYS_XMYS2019(部分字段)
目标 :将B表的ysxmh用A表的newysxmh代替。代替条件A表的oidysxmh = B表的ysxmh
update B set B.ysxmh = A.newysxmh from A,B where A.oldysxmh = B.ysxmh;
( UPDATE TYS_XMYS2019 SET TYS_XMYS2019.YSXMH=TYS_XM_RELATION2019.newYsxmh FROM TYS_XMYS2019, TYS_XM_RELATION2019
WHERE TYS_XMYS2019.YSXMH=TYS_XM_RELATION2019.oldYsxmh AND TYS_XMYS2019.HBDWBH=TYS_XM_RELATION2019.HBDWBH AND TYS_XMYS2019.HBDWBH='3501' )
转载于:https://www.cnblogs.com/easyunion/p/10437257.html