<%
exec="SELECT GOODSID,MEMORYCODE from GOODS"
set rs=server.createobject("adodb.recordset")
rs.open exec,conn,1,1
abc = rs("goodsid")
exec1="SELECT SUM(billqty)AS A FROM c_gccs WHERE GOODSID ="&abc
set rs1=server.createobject("adodb.recordset")
rs1.open exec1,conn,1,1
%>
<html>
<head>
<title>无标题文档</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<%
do while not rs.eof
%>
<tr>
<td><%=rs("goodsid")%></td>
<td><%=rs("MEMORYCODE")%></td>
<td><%=rs1("A")%></td>
<%
rs.movenext
loop
%>
</tr>
</table>
上述语名怎样才能让它,根据RS列出来表的内容进行汇总,我汇总出来的都是第一个的内容的和,不会计算下一个的。