Mysql刪除重復的數(shù)據(jù) Mysql數(shù)據(jù)去重復
MySQL數(shù)據(jù)庫中查詢重復數(shù)據(jù)
select * from employee group by emp_name having count (*)>1;
Mysql 查詢可以刪除的重復數(shù)據(jù)
select t1.* from employee t1 where (t1.emp_name) in (select t4.emp_name from (select t2.emp_name from employee t2 group by t2.emp_name having count(*)>1) t4) and t1.emp_id not in (select t5.emp_id from (select min(t3.emp_id) as emp_id from employee t3 group by t3.emp_name having count(*)>1) t5);
Mysql 刪除重復的數(shù)據(jù)
delete t1 from employee t1 where (t1.emp_name) in (select t4.emp_name from (select t2.emp_name from employee t2 group by t2.emp_name having count(*)>1) t4) and t1.emp_id not in (select t5.emp_id from (select min(t3.emp_id) as emp_id from employee t3 group by t3.emp_name having count(*)>1) t5);
相關(guān)文章
Mysql 如何實現(xiàn)多張無關(guān)聯(lián)表查詢數(shù)據(jù)并分頁
這篇文章主要介紹了Mysql 實現(xiàn)多張無關(guān)聯(lián)表查詢數(shù)據(jù)并分頁的操作,具有很好的參考價值,希望對大家有所幫助。如有錯誤或未考慮完全的地方,望不吝賜教2021-06-06mysql使用insert into select插入查出的數(shù)據(jù)
這篇文章主要介紹了mysql使用insert into select插入查出的數(shù)據(jù)方式,具有很好的參考價值,希望對大家有所幫助,如有錯誤或未考慮完全的地方,望不吝賜教2023-12-12Windows Server 2003 下配置 MySQL 集群(Cluster)教程
這篇文章主要介紹了Windows Server 2003 下配置 MySQL 集群(Cluster)教程,本文先是講解了原理知識,然后給出詳細配置步驟和操作方法,需要的朋友可以參考下2015-06-06innodb 庫的備份注意點(由phpmyadmin引起的解決方案)
新版本xampps 1.8.5 X64 集成了phpmyadmin最新版本(4.1.0), 可每次初始化安裝程序后, 進入phpmyadmin管理工具, 就會發(fā)現(xiàn)phpmyadmin高級功能失效, 一直在提示數(shù)據(jù)表不存在, 經(jīng)過再三的分析, 終于找到原因2013-12-12mysql group_concat()函數(shù)用法總結(jié)
這篇文章主要介紹了mysql group_concat()函數(shù)用法,結(jié)合實例形式較為詳細的group_concat()函數(shù)的功能、使用方法與相關(guān)注意事項,需要的朋友可以參考下2016-06-06