文章詳情頁
如何不用一條一條刪除MySQL數(shù)據(jù)
瀏覽:179日期:2022-06-16 16:30:13
問題描述
select查詢數(shù)據(jù)庫里面有幾萬條id數(shù)據(jù),select id from tb1 where serverindex = 2;223323424353...現(xiàn)在需要根據(jù)上面查詢到的id,把數(shù)據(jù)刪除,有什么快速的方法不用一條一條刪除delete from tb2 where id = 2233...
問題解答
回答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:
上面的答案通通錯誤!對于你來說!你只能安裝Navicat Premium這個軟件來解決!why,因為樓上的都是基礎(chǔ)知識!
相關(guān)文章:
1. nignx - docker內(nèi)nginx 80端口被占用2. 關(guān)于docker下的nginx壓力測試3. docker容器呢SSH為什么連不通呢?4. docker - 各位電腦上有多少個容器啊?容器一多,自己都搞混了,咋辦呢?5. 關(guān)docker hub上有些鏡像的tag被標(biāo)記““This image has vulnerabilities””6. mac里的docker如何命令行開啟呢?7. javascript - 連續(xù)點擊觸發(fā)mouseleave事件8. angular.js使用$resource服務(wù)把數(shù)據(jù)存入mongodb的問題。9. macos - mac下docker如何設(shè)置代理10. docker gitlab 如何git clone?
排行榜

熱門標(biāo)簽
網(wǎng)公網(wǎng)安備