在 MySQL 中“SHOW TABLE”语句具有多个 LIKE 值?
可以使用 WHERE 子句和 OR 运算符来显示带有多个 LIKE 的表。语法如下
show table from yourDatabaseName where tables_in_yourDatabaseName Like ‘%anyTableName%’ or tables_in_yourDatabaseName Like ‘%anyTableName2%’ or tables_in_yourDatabaseName Like ‘%anyTableName3%’ . . . . or tables_in_yourDatabaseName Like ‘%anyTableNameN%’
在上述语法中,只显示了数据库中的表名。
这里考虑了数据库“test”及其中的表。用于显示带有多个 LIKE 的表的查询如下 -
mysql> show tables from test -> where tables_in_test like '%userrole%' -> or tables_in_test like '%view_student%' -> or tables_in_test like '%wholewordmatchdemo%';
以下是输出。
+--------------------+ | Tables_in_test | +--------------------+ | userrole | | view_student | | wholewordmatchdemo | +--------------------+ 3 rows in set (0.01 sec)
广告