當前位置:首頁 » 操作系統 » mysql刪除重復的資料庫

mysql刪除重復的資料庫

發布時間: 2024-08-22 08:42:58

❶ 求一個mysql資料庫刪除重復數據的SQL語句

delete from article_chapter where aid not in(select max(aid) from article_chapter group by articleid , chaptername)

❷ 在Mysql下如何刪除重復的數據~

首先先創建一個臨時表,然後將author表中無重復的數據拎出來,放進臨時表中。
create temporary table 表名
select distinct id,name,password
from author

然後將author表中的記錄全部刪除。
delete from author

最後將臨時表中的記錄插入author表中
insert into author (id,name,password)
select id,name,password
from 臨時表

❸ Mysql資料庫中多條重復數據,如何只刪除一條

這個需要分情況。
1,你的資料庫表中有主鍵,且主鍵上面的數據為唯一值。也就是沒有重復值。
那麼你在刪除的時候,將這個唯一值作為條件進行刪除。
如:
delete
from
[表名]
where
id=1
2.所有的數據相同,那麼你只能打開數據表,手工選定其中某一條,進行刪除。

熱點內容
androiddagger2 發布:2025-09-16 04:38:38 瀏覽:120
javahttp編程 發布:2025-09-16 04:33:44 瀏覽:300
壓縮安裝器 發布:2025-09-16 03:47:17 瀏覽:178
特產網源碼 發布:2025-09-16 03:42:24 瀏覽:328
安卓faceplay怎麼付款 發布:2025-09-16 03:32:34 瀏覽:584
安卓rom包里有什麼 發布:2025-09-16 03:07:57 瀏覽:353
sql2005無法連接 發布:2025-09-16 03:04:21 瀏覽:683
預埋件演算法 發布:2025-09-16 02:55:45 瀏覽:93
php取差集 發布:2025-09-16 02:46:58 瀏覽:974
ah腳本掃貨 發布:2025-09-16 02:44:53 瀏覽:73