SHOW TABLES
编辑SHOW TABLES
编辑语法
SHOW TABLES [CATALOG [catalog_identifier | LIKE pattern]]? [INCLUDE FROZEN]? [table_identifier | LIKE pattern]?
有关模式的更多信息,请参阅 索引模式。
描述: 列出当前用户可用的表及其类型。
SHOW TABLES; catalog | name | type | kind ---------------+---------------+----------+--------------- javaRestTest |emp |TABLE |INDEX javaRestTest |employees |VIEW |ALIAS javaRestTest |library |TABLE |INDEX
使用 Elasticsearch 多目标语法 符号匹配多个索引
SHOW TABLES "*,-l*"; catalog | name | type | kind ---------------+---------------+----------+--------------- javaRestTest |emp |TABLE |INDEX javaRestTest |employees |VIEW |ALIAS
还可以使用 LIKE
子句将名称列表限制为给定的模式。
模式可以是完全匹配
SHOW TABLES LIKE 'emp'; catalog | name | type | kind ---------------+---------------+----------+--------------- javaRestTest |emp |TABLE |INDEX
多个字符
SHOW TABLES LIKE 'emp%'; catalog | name | type | kind ---------------+---------------+----------+--------------- javaRestTest |emp |TABLE |INDEX javaRestTest |employees |VIEW |ALIAS
单个字符
SHOW TABLES LIKE 'em_'; catalog | name | type | kind ---------------+---------------+----------+--------------- javaRestTest |emp |TABLE |INDEX
或单个字符和多个字符的混合
SHOW TABLES LIKE '%em_'; catalog | name | type | kind ---------------+---------------+----------+--------------- javaRestTest |emp |TABLE |INDEX
列出远程集群中名称与通配符匹配的表
SHOW TABLES CATALOG 'my_*' LIKE 'test_emp%'; catalog | name | type | kind -----------------+---------------+---------------+--------------- my_remote_cluster|test_emp |TABLE |INDEX my_remote_cluster|test_emp_copy |TABLE |INDEX