Mysql 刪除資料後id重新排序

2021-10-07 16:26:06 字數 431 閱讀 1341

我就遇到這個情況了,採集了5個站,我並到乙個表裡面去了,結果發現有乙個站的資源卡一丟丟就算了,5%的鏈結直接失效了

我可不得把他剔除出去

直接正題吧

:1刪除原來的主鍵

alter table `mac_vod` drop `vod_id`;
重新新增自增

alter table mac_vod add vod_id mediumint(8) not null primary key auto_increment first;
end~

番外:替換指定列中的指定文字

update `ct_vod` set `vod_class` = '擂台格鬥' where `vod_class` = '獨家擂台格鬥'

MySQL刪除資料

mysql通過delete從表中刪除 去掉 資料。可以從表中刪除特定的行或者從表中刪除所有的行。下面語句是從customer表中刪除一行 delete from customers where cust id 10006 先檢視表customers在刪除前的成員 select cust id,cus...

MySQL 刪除資料

從資料表中刪除資料使用 delete 語句,delete 語句允許用 where 子句指定刪除條件。語法格式 delete from table name where table name 要執行刪除操作的表 where 為可選引數,用於指定刪除條件,如果沒有 where 子句,將刪除表中的所有記錄...

MYSQL刪除資料

884 535 qq.com 一 mysql 刪除表的幾種情況 1 drop table table name 刪除表全部資料和表結構,立刻釋放磁碟空間,不管是 innodb 和 myisam 例項,刪除學生表 drop table student 2 truncate table table na...