You can use the SHOW TABLES syntax to view all tables that meet the specified conditions in a database. Before you use the CREATE TABLE syntax to create a table, you can use the SHOW TABLES syntax to view all existing tables in the current database to check whether the name of the table to create is the same as an existing table.
Applicable engines
The SHOW TABLES syntax is applicable to LindormTable and LindormTSDB.
Syntax
show_tables_statement ::= SHOW TABLES [ {FROM | IN} database_identifier ] [ LIKE string_literal ]Parameters
FROM | IN
Only LindormTable supports the FROM and IN keywords.
The FROM and IN keywords are both be used to specify the database in which the tables you want to query. For example, you can use any one of the following statements to view all tables in DB1: SHOW TABLES FROM DB1; and SHOW TABLES IN DB1;.
Fuzzy query statement (LIKE string_literal)
You can use the LIKE keyword in the SHOW TABLES syntax to view tables that are fuzzily matched to the specified table name. The following wildcards are supported:
%: This wildcard can be used to match multiple characters._: This wildcard can be used to match a single character.
Examples
View all tables in the current database
SHOW TABLES;View all tables in a specified database
SHOW TABLES FROM DB1;View all tables that match the specified conditions in the current database
View all tables whose names start with sensor in the current database.
SHOW TABLES LIKE 'sensor%';