select max(*::field) from sensor110 where time>'2024-05-14 06:40:00' group by time(1m) limit 10; 从截图中可以看到,时间是整分整分的。 加了偏移量的数据展示: select max(*::field) from sensor110 where time>'2024-05-14 06:40:00' group by time(1m,17s) limit 10; 从截图中可以看...
group by 对time分组聚合,需要注意两点,查询结果需要对field使用聚合函数,time后面需要加分组聚合的持续时间,完整语法如:select sum(field) from measurements group by time(1m)。 group by tag, time(1m)不管tag和time顺序如何,都是先对tag进行分组聚合,然后...
GROUP BY time(1m) 而single-groupby-x-y-z表示x个设备,z小时内,以y分钟为时间窗口 例如single-groupby-1-1-12表示一个设备,在12个小时内,以一分钟为时间窗口进行聚合。 从图中可以看出海东青在该分组下,qps是influxdb的1.5倍~6倍 double-groupby double-groupby指的是语句中同时带有group by window和group...
BEGIN SELECT count(allTime) as fail INTO online."default".sign_result FROM online."default".sign where orderFlag='0' GROUP BY time(1m) END CREATE CONTINUOUS QUERY success ON online BEGIN SELECT count(allTime) as success INTO online."default".sign_result FROM online."default".sign where or...
select count(allTime) from pay where time > now() - 10m group by time(1s) 5、用户管理命令 SHOW USERS CREATE USER jdoe WITH PASSWORD '1337password' -- Create a normal database user. CREATE USER jdoe WITH PASSWORD '1337password' WITH ALL PRIVILEGES -- Create an admin user. ...
嵌套子查询,类似以下SQL语句,从本质上讲,是嵌套函数。 SELECT mean(max("cpu_usage")) FROM "cpu_usage_detail" GROUP BY time(1m) 大多数InfluxQL的内置函数不支持函数的嵌套,可以借助连续查询来实现类似的功能,先通过连续查询做实现子查询功能,把结果保存到新表中,然后再对新表中的结果执行查询。 例如,统计...
error parsing query: GROUP BY requires at least one aggregate function 因为加了GROUP BY time(1m),可能同时有多个点,必须要有聚合函数汇聚成一个点,才能进行下一步。所以如果按时间聚合的话,必须要有聚合函数例如sum()之类的函数 SELECTsum("a"+"b"AS"c"FROM"tofino_bvr_vrouter_table"WHERE("A"=~/...
本文由 小马哥 创作,采用 知识共享署名4.0 国际许可协议进行许可 本站文章除注明转载/出处外,均为本...
SELECT sum(allTime) FROM "pay" WHERE time > now() - 10s select count(allTime) from pay where time > now() - 10m group by time(1s) 复制代码 5、用户管理命令 复制代码 SHOW USERS CREATE USER jdoe WITH PASSWORD '1337password' -- Create a normal database user. ...
> select mean(value) from cpu_used_percent where endpoint='Datacenter_172.118.16.19' and time >= '2021T09:00:00Z' and time <= '2021T09:10:00Z' group by time(1m) fill(previous); name: cpu_used_percent time mean --- --- 2021-09-17T09:00:00Z 2.2341273798866914 2021-09-17T09:...