下面写的有问题,请高手指教,谢!!
const arro :Array [1..8] of string = ('id1','id2','id3','id4','id5','id6','id7','id8');
var  i:integer;
     recondcount:integer;
begin
for i:=1 to 8 do
begin
with adoquery1 do
begin
close;
sql.Clear;
sql.Add('insert into C1 (item ,num, believe) select "'+arro[i]+'", sum('+arro[i]+'),sum('+arro[i]+')/recondcount  from test where '+arro[i]+'=1');
parameters.parambyname('recondcount').value:=test.recornd.count;
execsql;
end;
end;
end;