--生产工单变更单质检组织历史数据升级
UPDATE t_pom_xmftorderentry e SET fqualityorg=(SELECT fqualityorg FROM t_pom_mftorderentry where e.fsrcbillentryid is not null and e.fsrcbillentryid <> ' ' and fentryid=DECIMAL(e.fsrcbillentryid,23,0)) WHERE (EXISTS (SELECT 1 FROM t_pom_mftorderentry where e.fsrcbillentryid is not null and e.fsrcbillentryid <> ' ' and fentryid=DECIMAL(e.fsrcbillentryid,23,0)) AND (fqualityorg IS NULL));