当前位置: 首页 > 新闻动态 > 软件编程

Oracle删除重复的数据,Oracle数据去重复

作者:用户投稿 浏览: 发布日期:2026-01-17
[导读]:这篇文章主要介绍了Oracle删除重复的数据,Oracle数据去重复,需要的朋友可以参考下

Oracle  数据库中查询重复数据:

select * from employee group by emp_name having count (*)>1;

 Oracle  查询可以删除的重复数据

select t1.* from employee t1 where (t1.emp_name) in (SELECT t2.emp_name from employee t2 group by emp_name having count (*)>1) and t1.emp_id not in (select min(t3.emp_id) from employee t3 group by emp_name having count (*)>1);

Oracle 删除重复数据

delete from employee t1 where (t1.emp_name) in (SELECT t2.emp_name from employee t2 group by emp_name having count (*)>1) and t1.emp_id not in (select min(t3.emp_id) from employee t3 group by emp_name having count (*)>1);

免责声明:转载请注明出处:http://m.lexweb.cn/news/587490.html

扫一扫高效沟通

多一份参考总有益处

免费领取网站策划SEO优化策划方案

请填写下方表单,我们会尽快与您联系
感谢您的咨询,我们会尽快给您回复!