解决方案: |
在查询分析器中选择2006年度帐库(修改前请务必做好数据备份),执行脚本: update ia_subsidiary set valueid=g.bakid from ia_subsidiary inner join (select a.id,b.cvoucode,b.dvoudate,a.bakid,a.autoid2 from (select a1.autoid,b1.autoid as autoid2,b1.id,a1.bakid,b1.valueid from ia_valuationass a1 inner join ia_subsidiary b1 on a1.outid=b1.id and a1.bakid<>b1.valueid) a inner join (select a2.autoid,b2.cvoucode,b2.dvoudate from ia_valuationass a2 inner join ia_subsidiary b2 on a2.inid=b2.id where cvoutype='01') b on a.autoid=b.autoid) g on ia_subsidiary.autoid=g.autoid2 问题即可解决。 |