Lists all tables in a database that match the specified conditions. Before creating a table with CREATE TABLE, use SHOW TABLES to check whether the table name already exists in the current database.
Applicable engines
LindormTable and LindormTSDB.
Syntax
show_tables_statement ::= SHOW TABLES [ {FROM | IN} database_identifier ] [ LIKE string_literal ]Parameters
FROM | IN
FROMandINare supported only in LindormTable, not LindormTSDB.
Specifies the database to query. FROM and IN are interchangeable. For example, both of the following statements list all tables in DB1:
SHOW TABLES FROM DB1;
SHOW TABLES IN DB1;LIKE string_literal
Filters tables by matching the table name against the specified pattern. The following wildcards are supported:
| Wildcard | Description |
|---|---|
% | Matches multiple characters |
_ | Matches exactly one character |
Examples
List all tables in the current database
SHOW TABLES;List all tables in a specified database
SHOW TABLES FROM DB1;List tables matching a pattern
The following statement lists all tables in the current database whose names start with sensor:
SHOW TABLES LIKE 'sensor%';