社区
Delphi
帖子详情
怎样select 出重复的记录后删除,sql how to 写?
gum
2001-08-14 10:25:40
...全文
83
6
打赏
收藏
怎样select 出重复的记录后删除,sql how to 写?
复制链接
扫一扫
分享
转发到动态
举报
AI
作业
写回复
配置赞助广告
用AI写文章
6 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
tikkypeng
2001-08-16
打赏
举报
回复
Select Distinct 字段 From 表~~就可以了~~
Distinct就是去处相同行~~
lanren
2001-08-16
打赏
举报
回复
建一个临时表,先insert into加dinstict的select 语句先将不重复的记录倒入临时表,清空原表,再倒回来
nne998
2001-08-16
打赏
举报
回复
如果你的目的是整理表(删除重复)的话,可以这样:
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;
ch81
2001-08-14
打赏
举报
回复
dinstict加上去即可。不同的才出现。
tob
2001-08-14
打赏
举报
回复
用distinct就可以了。
xiaoxinxx168
2001-08-14
打赏
举报
回复
为什么要查出后再删除?为什么不用select distinct(ZGBH) from table来去掉重复的记录?
(ZGBH为表中的一个字段。)
《深入浅
出
SQL
》(Head First
SQL
)[PDF].part1
Head First
SQL
will show you the fundamentals of
SQL
and how to really take advantage of it. We'll take you on a journey through the language, from basic INSERT statements and
SELECT
queries to ...
Introducing
SQL
Server(Apress,2015)
You'll learn how databases work and how to use the T-
SQL
language by practicing on one of the most widely-used and powerful database engines in the corporate world: Microsoft
SQL
Server. Do you ...
SQL
Server 2014 Development Essentials - Masood-Al-Farooq, Basit A. [SRG].pdf
how you can use
SQL
Server Management Studio to create and manage
SQL
Server 2014 databases, schemas, and tables. Finally, this chapter covers the purpose of
SQL
Server 2014 system databases and ...
how-to-postgre
sql
:
SQL
示例集合
sql
-samples Postgre
SQL
数据库
SQL
示例的集合。 一般命令 connect : p
sql
--host localhost --user postgres 数据库 列
出
数据库: postgres=# \l 连接到数据库: postgres=# \c pandi 选择数据库大小:
select
pg_...
Learning
SQL
.rar_
Sql
queries_learning
sql
_objects
2.
SQL
Data Statements--those used to create, manipulate, and retrieve data stored in your database example statements include
select
, update, insert, and delete 3.
SQL
Schema Statements--those used to ...
Delphi
5,930
社区成员
262,936
社区内容
发帖
与我相关
我的任务
Delphi
Delphi 开发及应用
复制链接
扫一扫
分享
社区描述
Delphi 开发及应用
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章