怎样select 出重复的记录后删除,sql how to 写? 为什么要查出后再删除?为什么不用select distinct(ZGBH) from table来去掉重复的记录?(ZGBH为表中的一个字段。) 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 dinstict加上去即可。不同的才出现。 如果你的目的是整理表(删除重复)的话,可以这样:while true dobegin with query1 do begin close; sql.clear; sql.add('select * from 表名 group by 字段 having count(*)>1'); open; if recordcount=0 then break; first; while not eof do begin delete; next; end; end;end; 建一个临时表,先insert into加dinstict的select 语句先将不重复的记录倒入临时表,清空原表,再倒回来 Select Distinct 字段 From 表~~就可以了~~Distinct就是去处相同行~~ 宽屏下界面问题 在DELPHI可不可以打一张类似会计的记帐凭证. DataSet调用Cancel方法后为什么还要Post呢? delphi的前景? 这样的如何打包 代理服务器的用户认证 票据打印的疑问 如何在编程,实现Win2000下进程无法被结束? 对于d5来说是很简单的事情 怎么样向sql sever的过程传递参数?(回答了马上给分) 怎样得到listview中选定的列的item[3].subitems.text?(假设我现在选择的是第四列) 如何处理有关Form的创建问题,请高手递招???
while true do
begin
with query1 do
begin
close;
sql.clear;
sql.add('select * from 表名 group by 字段 having count(*)>1');
open; if recordcount=0 then break; first;
while not eof do
begin
delete;
next;
end;
end;
end;
Distinct就是去处相同行~~