MySQL中找出數據庫中以同一字符串開頭的表名的所有表 及清空表數據

查詢表名稱  bi_開頭

SELECT table_name from information_schema.columns where table_name like 'bi\_%' group by table_name;

 

清空表名稱  bi_開頭
SELECT CONCAT('delete from',table_name,';') FROM information_schema.columns where table_name like 'bi\_%' group by table_name;

 

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章