-- 查询所有表名,模糊匹配包含特定字符串的表
SELECT table_name
FROM information_schema.tables
WHERE table_schema = 'your_database_name'
AND table_name LIKE '%your_pattern%';
information_schema.tables:这是 MySQL 中的一个系统数据库表,包含了所有数据库中的表信息。table_schema = 'your_database_name':指定你要查询的数据库名称。将 'your_database_name' 替换为你的实际数据库名称。table_name LIKE '%your_pattern%':使用 LIKE 进行模糊匹配,% 是通配符,表示任意数量的字符。将 'your_pattern' 替换为你想要匹配的表名模式。例如,如果你想要查找所有表名中包含 user 的表,可以将 'your_pattern' 替换为 user。
上一篇:brew 启动mysql
下一篇:mysql时间加减
Laravel PHP 深圳智简公司。版权所有©2023-2043 LaravelPHP 粤ICP备2021048745号-3
Laravel 中文站