请求关于多条记录跟新的问题。。。。
我要修改一张表里多条记录的多个列的数据,数据是经过两张表关联计算出来的,我这样写,但出错,请高手帮助update gr001001 set tzjsgj='"&tzjsgj1&"',tzjsgh='"&tzjsgh1&"',tzcljsgj='"&tzcljsgj1&"',tzcljsgh='"&tzcljsgh1&"' where rekey in(
select tu.dwbm,tu.cjrq,tu.swh,tu.xmid,tu.rekey,tw.jsgj/tu.zjsgj*tw.jstzgj2 as tzjsgj1,jsgj/tu.zjsgj*tw.jstzgj2/js as tzjsgh1, tw.cljsgj/tu.zjsgj*tw.jstzgj2 as tzcljsgj1,tw.cljsgj/tu.zjsgj*tw.jstzgj2/cljs as tzcljsgh1 from (
select gr1.dwbm,gr1.xmid,gr1.swh,sum(jsgj)+sum(cljsgj) as zjsgj ,gr1.cjrq ,gr1.rekey from gr001001 gr1 where gr1.cjrq between '2010-7-1' and '2010-9-18'group by gr1.cjrq,gr1.xmid,gr1.dwbm,gr1.swh,gr1.rekey)tu
left join (select dw.dwbm as dwbm1,dw.cjrq as cjrq1,dw.dwmc as dwmc1,dw.jstzgj2,gr.cjrq,gr.dwbm,gr.dwmc,gr.xmid,gr.rekey,gr.swh,gr.jsgj,gr.cljsgj,gr.js,gr.cljs from dwsj dw
left join gr001001 gr on dw.dwbm=gr.dwbm and dw.cjrq=gr.cjrq where dw.cjrq between '2010-7-1' and '2010-9-18') tw on tu.dwbm=tw.dwbm1 and tu.xmid=tw.xmid and tu.swh=tw.swh and tu.cjrq=tw.cjrq
)
服务器: 消息 116,级别 16,状态 1,行 1
当没有用 EXISTS 引入子查询时,在选择列表中只能指定一个表达式。