1、查询满足某些条件的表名table_name
格式:
SELECT TABLE_NAME
FROM
information_schema. TABLES
WHERE
table_schema = '数据库名' AND TABLE_NAME LIKE '%name%';
查询全部:
use tg;
show tables;
示例:
精确查询
select table_name from information_schema.tables
where table_schema = 'sakila' and table_name like "%film%";
查询多个库
select table_name from information_schema.tables
where table_schema in ('tg','xcx');