2018-06-22 18:40:25 -04:00
|
|
|
[role="xpack"]
|
|
|
|
[testenv="basic"]
|
2018-06-20 14:40:13 -04:00
|
|
|
[[sql-syntax-show-tables]]
|
|
|
|
=== SHOW TABLES
|
|
|
|
|
|
|
|
.Synopsis
|
|
|
|
[source, sql]
|
|
|
|
----
|
2018-09-04 09:54:10 -04:00
|
|
|
SHOW TABLES [ table identifier<1> | [ LIKE pattern<2> ] ]?
|
2018-06-20 14:40:13 -04:00
|
|
|
----
|
|
|
|
|
2018-09-04 09:54:10 -04:00
|
|
|
<1> single table identifier or double quoted es multi index
|
|
|
|
<2> SQL LIKE pattern
|
|
|
|
|
2018-09-04 12:05:21 -04:00
|
|
|
See <<sql-index-patterns, index patterns>> for more information about
|
2018-09-04 09:54:10 -04:00
|
|
|
patterns.
|
|
|
|
|
2018-06-20 14:40:13 -04:00
|
|
|
|
|
|
|
.Description
|
|
|
|
|
2018-07-03 09:56:31 -04:00
|
|
|
List the tables available to the current user and their type.
|
|
|
|
|
|
|
|
["source","sql",subs="attributes,callouts,macros"]
|
|
|
|
----
|
|
|
|
include-tagged::{sql-specs}/docs.csv-spec[showTables]
|
|
|
|
----
|
|
|
|
|
2018-09-04 09:54:10 -04:00
|
|
|
Match multiple indices by using {es} <<multi-index,multi index syntax>>
|
|
|
|
notation:
|
|
|
|
|
|
|
|
["source","sql",subs="attributes,callouts,macros"]
|
|
|
|
----
|
|
|
|
include-tagged::{sql-specs}/docs.csv-spec[showTablesEsMultiIndex]
|
|
|
|
----
|
|
|
|
|
|
|
|
One can also use the `LIKE` clause to restrict the list of names to the given pattern.
|
2018-07-03 09:56:31 -04:00
|
|
|
|
|
|
|
The pattern can be an exact match:
|
|
|
|
["source","sql",subs="attributes,callouts,macros"]
|
|
|
|
----
|
|
|
|
include-tagged::{sql-specs}/docs.csv-spec[showTablesLikeExact]
|
|
|
|
----
|
|
|
|
|
|
|
|
Multiple chars:
|
|
|
|
["source","sql",subs="attributes,callouts,macros"]
|
|
|
|
----
|
|
|
|
include-tagged::{sql-specs}/docs.csv-spec[showTablesLikeWildcard]
|
|
|
|
----
|
|
|
|
|
|
|
|
A single char:
|
|
|
|
["source","sql",subs="attributes,callouts,macros"]
|
|
|
|
----
|
|
|
|
include-tagged::{sql-specs}/docs.csv-spec[showTablesLikeOneChar]
|
|
|
|
----
|
|
|
|
|
|
|
|
|
|
|
|
Or a mixture of single and multiple chars:
|
|
|
|
["source","sql",subs="attributes,callouts,macros"]
|
|
|
|
----
|
|
|
|
include-tagged::{sql-specs}/docs.csv-spec[showTablesLikeMixed]
|
|
|
|
----
|