1. 将需要包含表查询并放到临时表中:show tables;

2. 使用下面SQL生成删除不必要表的SQL:

select concat('drop table if exists `', a.table_name, '`;')
from information_schema.tables a left join tmp.a tmp
on a.table_name = tmp.name
where a.table_schema = 'cook' and tmp.name is null

3. 执行2中生成的SQL

相关文章:

  • 2021-08-28
  • 2021-10-17
  • 2022-12-23
  • 2021-04-02
  • 2022-12-23
  • 2021-06-28
  • 2022-01-16
猜你喜欢
  • 2022-12-23
  • 2021-05-20
  • 2022-12-23
  • 2021-09-06
  • 2021-09-24
  • 2022-12-23
  • 2021-08-11
相关资源
相似解决方案