如何不用一條一條刪除MySQL數(shù)據(jù)
問(wèn)題描述
select查詢(xún)數(shù)據(jù)庫(kù)里面有幾萬(wàn)條id數(shù)據(jù),select id from tb1 where serverindex = 2;223323424353...現(xiàn)在需要根據(jù)上面查詢(xún)到的id,把數(shù)據(jù)刪除,有什么快速的方法不用一條一條刪除delete from tb2 where id = 2233...
問(wèn)題解答
回答1:delete from tb2 where id in (select id from tb1 where serverindex = 2)
這樣不就可以了。。
回答2:delete from table2 tb2 left join tabele1 tb1 on tb2.id = tab1.id where tb1.serverindex = 2回答3:
drop database
回答4:DELETE FROM TABLE2 TB2 WHERE EXISTS (SELECT 1 FROM TABELE1 TB1 ON TB2.ID = TAB1.ID WHERE TB1.SERVERINDEX = 2)回答5:
上面的答案通通錯(cuò)誤!對(duì)于你來(lái)說(shuō)!你只能安裝Navicat Premium這個(gè)軟件來(lái)解決!why,因?yàn)闃巧系亩际腔A(chǔ)知識(shí)!
相關(guān)文章:
1. javascript - sublime快鍵鍵問(wèn)題2. javascript - immutable配合react提升性能?3. css - 寫(xiě)頁(yè)面遇到個(gè)布局問(wèn)題,求大佬們幫解答,在線(xiàn)等,急!~4. javascript - nodejs關(guān)于進(jìn)程間發(fā)送句柄的一點(diǎn)疑問(wèn)5. Apache 已經(jīng)把網(wǎng)站根目錄的改為allow from all了,但是服務(wù)器還是不能訪(fǎng)問(wèn)?6. 實(shí)現(xiàn)bing搜索工具urlAPI提交7. 配置Apache時(shí),添加對(duì)PHP的支持時(shí)語(yǔ)法錯(cuò)誤8. vue.js - Vue 如何像Angular.js watch 一樣監(jiān)聽(tīng)數(shù)據(jù)變化9. javascript - 移動(dòng)端上不能實(shí)現(xiàn)拖拽布局嗎?10. phpstudy8.1支持win11系統(tǒng)嗎?

網(wǎng)公網(wǎng)安備