2.5 KiB
2.5 KiB
| title | description | menu | weight | list_code_example | related | ||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| List tables | Use the [`SHOW TABLES` SQL statement](/influxdb3/cloud-dedicated/query-data/sql/explore-schema/#list-measurements-in-a-database) or the [`SHOW MEASUREMENTS` InfluxQL statement](/influxdb3/cloud-dedicated/query-data/influxql/explore-schema/#list-measurements-in-a-database) to list tables in a database. |
|
201 | ###### SQL ```sql SHOW TABLES ``` ###### InfluxQL ```sql SHOW MEASUREMENTS ``` |
|
Use the SHOW TABLES SQL statement
or the SHOW MEASUREMENTS InfluxQL statement
to list tables in a database.
{{% note %}} With {{< product-name >}}, tables and measurements are synonymous. {{% /note %}}
SQL
SHOW TABLES
InfluxQL
SHOW MEASUREMENTS
List tables with the influxctl CLI
To list tables using the influxctl CLI, use the influxctl query command to pass
the SHOW TABLES SQL statement.
{{% note %}}
The influxctl query command only supports SQL queries; not InfluxQL.
{{% /note %}}
Provide the following with your command:
- Database token: Database token
with read permissions on the queried database. Uses the
tokensetting from theinfluxctlconnection profile or the--tokencommand flag. - Database name: Name of the database to query. Uses the
databasesetting from theinfluxctlconnection profile or the--databasecommand flag. - SQL query: SQL query with the
SHOW TABLESstatement.
{{% code-placeholders "DATABASE_(TOKEN|NAME)" %}}
influxctl query \
--token DATABASE_TOKEN \
--database DATABASE_NAME \
"SHOW TABLES"
{{% /code-placeholders %}}
Replace the following:
- {{% code-placeholder-key %}}
DATABASE_TOKEN{{% /code-placeholder-key %}}: Database token with read access to the queried database - {{% code-placeholder-key %}}
DATABASE_NAME{{% /code-placeholder-key %}}: Name of the database to query