批量删除数据库中得所有表

先上sql:

select concat('DROP TABLE IF EXISTS ', table_name, ';')
from information_schema.tables
where table_schema = 'shcema_name'

schema_name 指的是具体得数据库,这样在获取结果集之后,就可以将结果集复制出来,进行执行了。

posted @ 2022-03-07 11:32  君莫笑我十年游  阅读(103)  评论(0编辑  收藏  举报