All Products
Search
Document Center

Lindorm:SHOW CONTINUOUS QUERIES

Last Updated:Mar 28, 2026

Lists all continuous queries in the current database. To view continuous queries in a different database, use the USE statement to switch databases first.

Applicable engines and versions

The SHOW CONTINUOUS QUERIES statement applies to all versions of LindormTSDB.

Syntax

show_cq_statement ::= SHOW CONTINUOUS QUERIES

Returned results

Column nameTypeDescription
nameVARCHARThe name of the continuous query.
intervalVARCHARThe interval at which the continuous query runs. For more information, see CREATE CONTINUOUS QUERY.
windowVARCHARThe time window of the data. Only data updated within the latest time window is included in the continuous query's calculations. For more information, see CREATE CONTINUOUS QUERY.
offsetVARCHARThe offset of the data time window. For more information, see CREATE CONTINUOUS QUERY.
queryVARCHARThe statement executed in the continuous query.

Examples

List all continuous queries in the current database.

SHOW CONTINUOUS QUERIES;

The following result is returned:

+-------+----------+--------------------------------+
| name  | interval |             query              |
+-------+----------+--------------------------------+
| my_cq | 1d       | INSERT INTO                    |
|       |          | `db_sensor_year`.`sensor`      |
|       |          | (SELECT MEAN(`temperature`)  |
|       |          | AS `temperature`,              |
|       |          | MEAN(`humidity`) AS          |
|       |          | `humidity`, `device_id`,       |
|       |          | `region` FROM                  |
|       |          | `db_sensor_month`.`sensor`)    |
+-------+----------+--------------------------------+