I have a measurement named “m1” in database “db1”, and I want to create a CQ to write the results to another measurement named “m2” in database “db2”.
CREATE CONTINUOUS QUERY "CQ" ON "db1"
BEGIN
SELECT mean("value") INTO "db2.autogen.m2" FROM "m1" GROUP BY time(1h)
END
CREATE CONTINUOUS QUERY "CQ" ON "db2"
BEGIN
SELECT mean("value") INTO "m2" FROM "db1.autogen.m1" GROUP BY time(1h)
END
both of the statement can fulfill my needs, so why not change the syntax to
CREATE CONTINUOUS QUERY <cq_name>
BEGIN
SELECT <function[s]>
INTO <db1.rp1.destination_measurement>
FROM <db2.rp2.measurement>
[WHERE <stuff>]
GROUP BY time(<interval>)[,<tag_key[s]>]
END