SELECT time,pointId,count(value) FROM “abnormal” GROUP BY pointId LIMIT 10
SELECT count(“value”) FROM “abnormal” WHERE $timeFilter GROUP BY time(1d), “pointId” fill(null)
SELECT count(“value”) FROM “abnormal” WHERE $timeFilter GROUP BY time(1d) fill(null)
#数据存储策略基本操作
#查询
SHOW RETENTION POLICIES ON datatest
#创建
CREATE RETENTION POLICY <retention_policy_name> ON <database_name> DURATION REPLICATION [SHARD DURATION ] [DEFAULT]
#修改
ALTER RETENTION POLICY “1d” ON “datatest” DURATION 1d DEFAULT
#删除
drop retention POLICY “2_hours” ON “telegraf”
#连续查询
#查询
SHOW CONTINUOUS QUERIES
#删除
DROP CONTINUOUS QUERY <cq_name> ON <database_name>
#创建
CREATE CONTINUOUS QUERY redis_1d ON hollysys_project BEGIN SELECT count(value) INTO abnormal_copy_1d_count FROM abnormal GROUP BY time(1d), “pointId” END