刪除mysql數(shù)據(jù)庫中的重復(fù)數(shù)據(jù)記錄
更新時(shí)間:2008年06月17日 19:18:22 作者:
mysql中select distinct * from text不能顯示不重復(fù)的記錄,而是直接全部顯示
采用的是下面的方法可刪除,假設(shè)重復(fù)的是test數(shù)據(jù)庫中的title字段
create table bak as (select * from test group by title having count(*)=1);
insert into bak (select * from test group by title having count(*)>1);
truncate table test;
insert into test select * from bak;
復(fù)制代碼 代碼如下:
create table bak as (select * from test group by title having count(*)=1);
insert into bak (select * from test group by title having count(*)>1);
truncate table test;
insert into test select * from bak;
您可能感興趣的文章:
- mysql刪除重復(fù)記錄語句的方法
- MySQL中查詢、刪除重復(fù)記錄的方法大全
- mysql查找刪除重復(fù)數(shù)據(jù)并只保留一條實(shí)例詳解
- MySQL數(shù)據(jù)庫中刪除重復(fù)記錄的方法總結(jié)[推薦]
- mysql刪除表中某一字段重復(fù)的記錄
- mysql查找刪除表中重復(fù)數(shù)據(jù)方法總結(jié)
- mysql刪除重復(fù)行的實(shí)現(xiàn)方法
- 刪除MySQL重復(fù)數(shù)據(jù)的方法
- MySQL中刪除重復(fù)數(shù)據(jù)的簡單方法
- Mysql刪除重復(fù)數(shù)據(jù)通用SQL的兩種方法
相關(guān)文章
mysql8.0?lower_case_table_names?大小寫敏感設(shè)置問題解決
在默認(rèn)情況下,這個(gè)變量是設(shè)置為0的,以保持向前兼容性,如果將該變量設(shè)置為1,則表名和數(shù)據(jù)庫名將被區(qū)分大小寫,本文主要介紹了mysql8.0?lower_case_table_names?大小寫敏感設(shè)置問題解決,感興趣的可以了解一下2023-09-09Java將excel中的數(shù)據(jù)導(dǎo)入到mysql中
這篇文章主要介紹了Java將excel中的數(shù)據(jù)導(dǎo)入到數(shù)據(jù)庫,小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,需要的朋友可以參考借鑒2018-05-05