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);
您可能感兴趣的文章:- oracle数据库的删除方法详解
- Oracle删除数据报ORA 02292错误的巧妙解决方法
- oracle 数据按主键删除慢问题的解决方法
- Oracle数据库中的级联查询、级联删除、级联更新操作教程
- Oracle误删除表数据后的数据恢复详解
- 彻底删除Oracle数据库的方法
- oracle查询重复数据和删除重复记录示例分享
- oracle数据库添加或删除一列的sql语句
- oracle 批量删除表数据的几种方法