Oracle刪除重復(fù)的數(shù)據(jù),Oracle數(shù)據(jù)去重復(fù)
Oracle 數(shù)據(jù)庫中查詢重復(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);
相關(guān)文章
深入淺析Oracle數(shù)據(jù)庫管理之創(chuàng)建和刪除數(shù)據(jù)庫
本篇文章給大家介紹oracle數(shù)據(jù)庫管理之創(chuàng)建和刪除數(shù)據(jù)庫,本文從數(shù)據(jù)庫管理概述、數(shù)據(jù)庫管理方法、數(shù)據(jù)庫的準(zhǔn)則、使用dbca創(chuàng)建數(shù)據(jù)庫、使用dbca刪除數(shù)據(jù)庫等五大方面展開話題,需要的朋友一起學(xué)習(xí)吧2015-10-10使用geotools導(dǎo)入shp文件到Oracle數(shù)據(jù)庫時表名帶下劃線問題的解決方法
這篇文章主要介紹了使用geotools導(dǎo)入shp文件到Oracle數(shù)據(jù)庫時表名帶下劃線的問題解決 的相關(guān)資料,需要的朋友可以參考下2016-08-08Oracle中的半聯(lián)結(jié)和反聯(lián)結(jié)詳解
這篇文章主要介紹了Oracle中的半聯(lián)結(jié)和反聯(lián)結(jié)詳解,也稱半連接和反連接,其實(shí)就是in、exists,需要的朋友可以參考下2014-07-07Oracle Arraysize設(shè)置對于邏輯讀的影響實(shí)例分析
這篇文章主要介紹了Oracle Arraysize設(shè)置對于邏輯讀的影響實(shí)例分析,通過設(shè)置Arraysize大幅減少了邏輯讀的次數(shù)和網(wǎng)絡(luò)往返次數(shù),需要的朋友可以參考下2014-07-07PLSQL安裝、漢化和激活的方法步驟實(shí)現(xiàn)
這篇文章主要介紹了PLSQL安裝、漢化和激活的方法步驟實(shí)現(xiàn),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2019-09-09