merge into JNGHCG.SSG_GCHX_PY gc using (SELECT T.PROJECTCODE AS PROJECTCODE,R.YDXZ AS YDXZ FROM BZ_PROJECTCASE T LEFT JOIN BZ_GC_HXSJ R ON R.CID = T.ID) B on(b.projectcode = gc.xmid) when matched then update set gc.ydxz = b.ydxz where gc.objectid = 10644