国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁(yè) > 數(shù)據(jù)庫(kù) > Oracle > 正文

Oracle刪除重復(fù)的數(shù)據(jù),Oracle數(shù)據(jù)去重復(fù)

2024-08-29 13:59:16
字體:
供稿:網(wǎng)友

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


注:相關(guān)教程知識(shí)閱讀請(qǐng)移步到oracle教程頻道。
發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 潮州市| 平利县| 阿克陶县| 来凤县| 周至县| 四川省| 玉树县| 嫩江县| 栾城县| 新泰市| 天门市| 琼海市| 灌阳县| 张家港市| 贡嘎县| 腾冲县| 凯里市| 陆河县| 靖江市| 永德县| 华宁县| 柞水县| 鸡东县| 定安县| 麻江县| 泸定县| 麻城市| 五华县| 济宁市| 通城县| 章丘市| 会昌县| 万安县| 江城| 永丰县| 沾益县| 北碚区| 临洮县| 隆尧县| 和田县| 承德县|