當前位置:首頁 » 操作系統 » 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-17 13:18:53 瀏覽:504
新版安卓為什麼不兼容 發布:2025-03-17 13:18:49 瀏覽:480
s3哪個配置性價比高 發布:2025-03-17 13:06:09 瀏覽:317
氣體壓縮能量 發布:2025-03-17 13:00:16 瀏覽:75
壓縮油19 發布:2025-03-17 12:25:29 瀏覽:856
linux上網代理 發布:2025-03-17 12:23:56 瀏覽:359
c是高級語言嗎 發布:2025-03-17 12:16:31 瀏覽:523
python泛型 發布:2025-03-17 12:15:01 瀏覽:482
編程貓被盜 發布:2025-03-17 12:02:18 瀏覽:131
海關鎖密碼箱如何設置新密碼 發布:2025-03-17 11:53:50 瀏覽:560