批量删除特定前缀的表

第一步:拼装sql语句

Select CONCAT( 'drop table ', table_name, ';' ) FROM information_schema.tables Where table_name LIKE 'CA_%';


wKiom1majyzxbuLhAAAcE0BJqZk929.png


第二步:把红框中内容选中复制粘贴执行即可

小技巧:为了不选中竖杆(|),Alt+鼠标左键是列选中,这样就可以选中红框中的内容



批量修改表前缀

第一步:拼装sql语句

select concat('alter table ',table_name,' rename to cj_',substring(table_name,5),';') from information_schema.tables where 
table_name like 'xws_%';


第二步:选中复制粘贴结果,执行即可