当前位置: 移动技术网 > IT编程>数据库>Oracle > Oracle删除重复的数据,Oracle数据去重复

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

2017年12月08日  | 移动技术网IT编程  | 我要评论

pp小月,春秋航空特价机票查询,真空烤箱

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);

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网