W
wangqinyun2000
Unregistered / Unconfirmed
GUEST, unregistred user!
表1CWBDC<br>字段<br>CGDH LH JHSL <br>X1 Y1 0<br>X9 Y3 0<br>表2#JHMXTEMP1<br>字段<br>CGDH BH JHSL <br>X1 Y1 23<br>X1 Y1 40<br>X9 Y3 90<br>X9 Y3 100<br><br>表1CWBDC.JHSL等于表2#JHMXTEMP1.JHSL的和,条件是1CWBDC.CGDH=表2#JHMXTEMP1.CGDH AND CWBDC.LH =#JHMXTEMP1.BH<br><br><br>最终表1CWBDC结果为:<br>CGDH LH JHSL <br>X1 Y1 63<br>X9 Y3 190<br><br><br>ADOQ1.SQL.Add('update CWBDC SET CWBDC.JHSL=(select SUM(#JHMXTEMP1.JHSL) FROM #JHMXTEMP1,CWBDC WHERE #JHMXTEMP1.CGDH=CWBDC.CGDH AND #JHMXTEMP1.BH =CWBDC.LH group by #JHMXTEMP1.CGDH,#JHMXTEMP1.BH)');<br><br>上面代码得为不到正确的结果,帮忙看看