SQL批量删除相同前缀的表

-- 执行得到批量删除语句
select CONCAT('drop table ', table_name, ';')
from information_schema.tables
where table_name like 'pre_%';
-- 执行结果:
drop table pre_account;
drop table pre_user;

 

posted @ 2022-04-01 16:26  一隅桥畔  阅读(257)  评论(0)    收藏  举报