日期:2014-05-17 浏览次数:21220 次
select tgv.fid,tgv.fbookeddate,tgv.fnumber,tgve.flocalamount,tgve.fid,tgve.faccountid,tgvar.fid,tgvar.fentryid,tgvar.fassgrpid,tgvar.fbillid from T_GL_VoucherAssistRecord tgvar, T_GL_Voucher tgv,T_GL_VoucherEntry tgve where tgvar.FAssGrpID='ZZW0XxLMQjqiyV/6c9PO2kGKbLs=' and tgvar.fbillid=tgv.fid and tgv.fcompanyid='X6LYi/UfSGuuUA9ZNwxJasznrtQ=' and tgvar.fentryid=tgve.fid and tgve.faccountid='TIwPYRKyRUy4gNse9h1Z+p2pmCY=' order by fbookeddate
update T_GL_VoucherAssistRecord t set t.FAssGrpID=? -- 更新 FAssGrpID值为其它值 where (t.fid,t.fentryid,t.fassgrpid,t.fbillid) in ( select tgvar.fid, tgvar.fentryid, tgvar.fassgrpid, tgvar.fbillid from T_GL_VoucherAssistRecord tgvar, T_GL_Voucher tgv, T_GL_VoucherEntry tgve where tgvar.FAssGrpID = 'ZZW0XxLMQjqiyV/6c9PO2kGKbLs=' and tgvar.fbillid = tgv.fid and tgv.fcompanyid = 'X6LYi/UfSGuuUA9ZNwxJasznrtQ=' and tgvar.fentryid = tgve.fid and tgve.faccountid = 'TIwPYRKyRUy4gNse9h1Z+p2pmCY=' )
------解决方案--------------------
请参考:
UPDATE T_GL_VoucherAssistRecord SET FAssGrpID = 更新后的值 WHERE EXISTS (select 1 from T_GL_VoucherAssistRecord tgvar, T_GL_Voucher tgv,T_GL_VoucherEntry tgve where tgvar.FAssGrpID='ZZW0XxLMQjqiyV/6c9PO2kGKbLs=' and tgvar.fbillid=tgv.fid and tgv.fcompanyid='X6LYi/UfSGuuUA9ZNwxJasznrtQ=' and tgvar.fentryid=tgve.fid and tgve.faccountid='TIwPYRKyRUy4gNse9h1Z+p2pmCY=');