各位大侠:小弟写的程序
begin //occasional_table表中的记录与表ENTERPRISE进行比较,把重复记录保存到enterprise_1中,把不重复的记录插入到ENTERPRISE中,并在DBGRID2中显示出来,
dm1.aq_check.Close;
dm1.aq_check.SQL.Clear;
dm1.aq_check.SQL.Add('insert into enterprise_1 select occasional_table.* from occasional_table,enterprise where enterprise.name = occasional_table.name');
dm1.aq_check.ExecSQL;
end;数据比较少时,程序运行正常,数据多了,程序运行时报错:超时,请问怎么解决这个问题啊?
begin //occasional_table表中的记录与表ENTERPRISE进行比较,把重复记录保存到enterprise_1中,把不重复的记录插入到ENTERPRISE中,并在DBGRID2中显示出来,
dm1.aq_check.Close;
dm1.aq_check.SQL.Clear;
dm1.aq_check.SQL.Add('insert into enterprise_1 select occasional_table.* from occasional_table,enterprise where enterprise.name = occasional_table.name');
dm1.aq_check.ExecSQL;
end;数据比较少时,程序运行正常,数据多了,程序运行时报错:超时,请问怎么解决这个问题啊?
procedure TForm1.Button1Click(Sender: TObject);
begin
with ADOQuery1 do
begin
close;
SQL.clear;
SQL.ADD('select sex from Tbl1 group by sex having count(*)>1');
open;
Label1.Caption:=ADOQuery1.Fields[0].value; //ADOQuery附值
end;
end;
end.
你的程序,小弟看过了,查询一个表中的重复纪录,很好用!
小弟,有三个表:occasional_table(临时存放导入的数据)、enterprise(总库)、enterprise_1(存放重复的数据)。
小弟,想让occasional_table表中的记录与表ENTERPRISE中的纪录进行比较,找出重复的纪录,把重复记录从occasional_table中删除,然后保存到enterprise_1中,把不重复的记录插入到ENTERPRISE中。
在运行的过程中遇到了上面的问题,请问该怎么解决呢?