特定前缀的mysql表批量删除和修改详细流程
发布时间:2023-10-07 15:23:27 所属栏目:MySql教程 来源:
导读:批量删除特定前缀的表
第一步:拼装sql语句
Select CONCAT( 'drop table ', table_name, ';' ) FROM information_schema.tables Where table_name LIKE 'CA_%';
第二步:把红框中
第一步:拼装sql语句
Select CONCAT( 'drop table ', table_name, ';' ) FROM information_schema.tables Where table_name LIKE 'CA_%';
第二步:把红框中
批量删除特定前缀的表 第一步:拼装sql语句 Select CONCAT( 'drop table ', table_name, ';' ) FROM information_schema.tables Where table_name LIKE 'CA_%'; 第二步:把红框中内容选中复制粘贴执行即可 小技巧:为了不选中竖杆(|),Alt+鼠标左键是列选中,这样就可以选中红框中的内容 批量修改表前缀 第一步:拼装sql语句 select concat('alter table ',table_name,' rename to cj_',substring(table_name,5),';') from information_schema.tables where table_name like 'xws_%'; 第二步:选中复制粘贴结果,执行即可 (编辑:聊城站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
推荐文章
站长推荐