MySQL中找出数据库中以同一字符串开头的表名的所有表 及清空表数据

版权声明:欢迎查看,随便复制! https://blog.csdn.net/hunhun1122/article/details/85059390

查询表名称  bi_开头

SELECT table_name from information_schema.columns where table_name like 'bi\_%' group by table_name;

清空表名称  bi_开头
SELECT CONCAT('delete from',table_name,';') FROM information_schema.columns where table_name like 'bi\_%' group by table_name;

猜你喜欢

转载自blog.csdn.net/hunhun1122/article/details/85059390