You can use the DROP CONTINUOUS QUERY syntax to delete a continuous query.
Applicable engines and versions
The DROP CONTINUOUS QUERY syntax is applicable only to LindormTSDB. The DROP CONTINUOUS QUERY syntax is supported by all versions of LindormTSDB.
Syntax
drop_cq_statement ::= DROP CONTINUOUS QUERY [database_identifier.cq_identifier]
Parameters
Database name (database_identifier)
The name of the database that stores the data to be queried. If you do not specify this parameter, the value of this parameter is set to the current database by default. The database name must be enclosed by a pair of backticks (`). Example: `db_sensor`
.
Continuous query name (cq_identifier)
The name of the continuous query that you want to delete. You can use the SHOW CONTINUOUS QUERIES
syntax to view the names of all continuous queries performed in the current database and check whether the query that you specify needs to be deleted. For more information about the SHOW CONTINUOUS QUERIES syntax, see SHOW CONTINUOUS QUERIES.
The query name must be enclosed by a pair of backticks (`). Example: `my_cq`
.
Examples
Delete a continuous query named my_cq from the db_sensor database.
DROP CONTINUOUS QUERY `db_sensor`.`my_cq`;