S
shuaige
Unregistered / Unconfirmed
GUEST, unregistred user!
我的数据库的操作是这样的
with QGradedo
begin
Close;
SQL.Clear;
SQL.Text:='Select * from freshgrade order by total8';
Open;// 按总分顺序排列;
first;
i:=1;
while not Eofdo
begin
setorder[1]:=FieldByName(f8).ASInteger;
Next;
i:=i+1;
end;
//将数据读入数组;
n:=i-1;
setorder[1][2]:=1;
for i:=2 to ndo
begin
if setorder[1]=setorder[i-1][1] then
setorder[2]:=setorder[i-1][2]
else
setorder[2]:=i;
end;
//按总分排好名次;
first;
i:=1;
while not Eofdo
begin
edit;
FieldByName('Torder8').AsInteger:=setorder[2];
i:=i+1;
Next;
end;
//更新数据库;
Applyupdates;//提交作业;
end;
CJ 你说该如何处理速度会快些。
with QGradedo
begin
Close;
SQL.Clear;
SQL.Text:='Select * from freshgrade order by total8';
Open;// 按总分顺序排列;
first;
i:=1;
while not Eofdo
begin
setorder[1]:=FieldByName(f8).ASInteger;
Next;
i:=i+1;
end;
//将数据读入数组;
n:=i-1;
setorder[1][2]:=1;
for i:=2 to ndo
begin
if setorder[1]=setorder[i-1][1] then
setorder[2]:=setorder[i-1][2]
else
setorder[2]:=i;
end;
//按总分排好名次;
first;
i:=1;
while not Eofdo
begin
edit;
FieldByName('Torder8').AsInteger:=setorder[2];
i:=i+1;
Next;
end;
//更新数据库;
Applyupdates;//提交作业;
end;
CJ 你说该如何处理速度会快些。