select concat(\'drop table if exists \',table_name,\';\') from information_schema.tables where table_schema = \'mytestdb\'
通过在information_schema中查询出数据库名为mytestdb下的所有表然后进行删表语句拼接,之后再执行查询并拼接好的所有的删表语句就行了。
select concat(\'drop table if exists \',table_name,\';\') from information_schema.tables where table_schema = \'mytestdb\'
通过在information_schema中查询出数据库名为mytestdb下的所有表然后进行删表语句拼接,之后再执行查询并拼接好的所有的删表语句就行了。
相关文章: