当前位置:网站首页>Oracle deletes duplicate data, leaving only one
Oracle deletes duplicate data, leaving only one
2022-07-06 04:58:00 【Terence-Wang】
Query and delete duplicate records SQL sentence
1、 Look up redundant duplicate records in the table , Duplicate records are based on a single field (Id) To judge
select * from surface where Id in (select Id from surface group byId having count(Id) > 1)2、 Delete redundant duplicate records in the table , Duplicate records are based on a single field (Id) To judge , There is only rowid Minimum record
DELETE from surface WHERE (id) IN ( SELECT id FROM surface GROUP BY id HAVING COUNT(id) > 1)
AND ROWID NOT IN (SELECT MIN(ROWID) FROM surface GROUP BY id HAVING COUNT(*) > 1);3、 Look up redundant duplicate records in the table ( Multiple fields )
select * from surface a where (a.Id,a.seq) in(select Id,seq from surface group by Id,seq having count(*) > 1)4、 Delete redundant duplicate records in the table ( Multiple fields ), There is only rowid Minimum record
delete from surface a where (a.Id,a.seq) in (select Id,seq from surface group by Id,seq having count(*) > 1)
and rowid not in (select min(rowid) from surface group by Id,seq having count(*)>1)5、 Look up redundant duplicate records in the table ( Multiple fields ), It doesn't contain rowid Minimum record
select * from surface a where (a.Id,a.seq) in (select Id,seq from surface group by Id,seq having count(*) > 1)
and rowid not in (select min(rowid) from surface group by Id,seq having count(*)>1)边栏推荐
- 8. Static file
- Postman manage test cases
- Yyds dry goods inventory OSI & tcp/ip
- Flody的应用
- Some common skills on unity inspector are generally used for editor extension or others
- ISP学习(2)
- Ue5 small knowledge points to enable the setting of lumen
- Cve-2019-11043 (PHP Remote Code Execution Vulnerability)
- Idea one key guide package
- yolov5 tensorrt加速
猜你喜欢

RT thread analysis - object container implementation and function

The underlying structure of five data types in redis

RTP GB28181 文件测试工具

SQL注入漏洞(MSSQL注入)

Lepton 无损压缩原理及性能分析

Selection of slow motion function

Why does MySQL need two-phase commit

Weng Kai C language third week 3.1 punch in

Crazy God said redis notes

Basic knowledge and examples of binary tree
随机推荐
图论的扩展
MPLS experiment
关于Unity Inspector上的一些常用技巧,一般用于编辑器扩展或者其他
Use sentinel to interface locally
Zynq learning notes (3) - partial reconfiguration
web工程导入了mysql驱动jar包却无法加载到驱动的问题
Microblogging hot search stock selection strategy
[NOIP2008 提高组] 笨小猴
Quelques conseils communs sur l'inspecteur de l'unit é, généralement pour les extensions d'éditeur ou d'autres
2021robocom robot developer competition (Preliminary)
Building intelligent gray-scale data system from 0 to 1: Taking vivo game center as an example
【LGR-109】洛谷 5 月月赛 II & Windy Round 6
Leetcode 186 Flip the word II in the string (2022.07.05)
Postman assertion
关于imx8mp的es8316的芯片调试
Platformio create libopencm3 + FreeRTOS project
Upload nestjs configuration files, configure the use of middleware and pipelines
[FreeRTOS interrupt experiment]
Three.js学习-光照和阴影(了解向)
Sqlserver query results are not displayed in tabular form. How to modify them