Oracle 數(shù)據(jù)庫(kù)中查詢重復(fù)數(shù)據(jù):
select * from employee group by emp_name having count (*)>1;
Oracle 查詢可以刪除的重復(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);
新聞熱點(diǎn)
疑難解答
圖片精選