当前位置:网站首页>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)边栏推荐
- Rce code and Command Execution Vulnerability
- Hometown 20 years later (primary school exercises)
- 关于imx8mp的es8316的芯片调试
- Principle and performance analysis of lepton lossless compression
- MySQL reported an error datetime (0) null
- The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower
- Supreme Court, judgment standard of divorce cases
- 驱动开发——HelloWDM驱动
- 组播和广播的知识点梳理
- 【LGR-109】洛谷 5 月月赛 II & Windy Round 6
猜你喜欢

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

Rce code and Command Execution Vulnerability

Embedded development program framework

The IPO of mesk Electronics was terminated: Henan assets, which was once intended to raise 800 million yuan, was a shareholder

Leetcode dynamic planning day 16

Building intelligent gray-scale data system from 0 to 1: Taking vivo game center as an example

Pagoda configuration mongodb

The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower

Codeforces Round #804 (Div. 2)

Extension of graph theory
随机推荐
Request (request object) and response (response object)
饼干(考试版)
DMA use of stm32
The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower
Flink kakfa data read and write to Hudi
Codeforces Round #804 (Div. 2)
Cve-2019-11043 (PHP Remote Code Execution Vulnerability)
The IPO of mesk Electronics was terminated: Henan assets, which was once intended to raise 800 million yuan, was a shareholder
[FreeRTOS interrupt experiment]
What should the project manager do if there is something wrong with team collaboration?
JS quick start (II)
Microblogging hot search stock selection strategy
Use sentinel to interface locally
ORM aggregate query and native database operation
内核判断i2c地址上是否挂载外设
The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower
ISP学习(2)
Vulnerability discovery - vulnerability probe type utilization and repair of web applications
麦斯克电子IPO被终止:曾拟募资8亿 河南资产是股东
[mathematical modeling] differential equation -- sustainable development of fishing industry