Oracle 數(shù)據(jù)庫(kù)中查詢(xún)重復(fù)數(shù)據(jù):
select * from employee group by emp_name having count (*)>1;
Oracle 查詢(xún)可以刪除的重復(fù)數(shù)據(jù)
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 刪除重復(fù)數(shù)據(jù)
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數(shù)據(jù)庫(kù)的刪除方法詳解
- Oracle刪除數(shù)據(jù)報(bào)ORA 02292錯(cuò)誤的巧妙解決方法
- oracle 數(shù)據(jù)按主鍵刪除慢問(wèn)題的解決方法
- Oracle數(shù)據(jù)庫(kù)中的級(jí)聯(lián)查詢(xún)、級(jí)聯(lián)刪除、級(jí)聯(lián)更新操作教程
- Oracle誤刪除表數(shù)據(jù)后的數(shù)據(jù)恢復(fù)詳解
- 徹底刪除Oracle數(shù)據(jù)庫(kù)的方法
- oracle查詢(xún)重復(fù)數(shù)據(jù)和刪除重復(fù)記錄示例分享
- oracle數(shù)據(jù)庫(kù)添加或刪除一列的sql語(yǔ)句
- oracle 批量刪除表數(shù)據(jù)的幾種方法