當前位置:首頁 » 操作系統 » 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.所有的數據相同,那麼你只能打開數據表,手工選定其中某一條,進行刪除。

熱點內容
社會腳本法定義 發布:2025-03-18 03:59:00 瀏覽:325
安卓擴展存儲空間 發布:2025-03-18 03:57:34 瀏覽:8
linuxat沒反應 發布:2025-03-18 03:56:51 瀏覽:580
怎麼看是多少位編譯器 發布:2025-03-18 03:47:32 瀏覽:659
solr索引存儲 發布:2025-03-18 03:46:52 瀏覽:329
縫合演算法 發布:2025-03-18 03:46:06 瀏覽:362
java遍歷二維數組 發布:2025-03-18 03:36:01 瀏覽:410
銳捷源碼 發布:2025-03-18 03:26:55 瀏覽:436
訴訟中止裁定後可否解壓 發布:2025-03-18 03:24:51 瀏覽:128
sqlserver全文搜索 發布:2025-03-18 03:23:58 瀏覽:715