https://www.timecho.com/docs/zh/UserGuide/latest/User-Manual/Query-Data.html#%E5%88%86%E6%AE%B5%E8%81%9A%E5%90%88
https://www.timecho.com/docs/zh/UserGuide/latest/Reference/Function-and-Expression.html#%E8%81%9A%E5%90%88%E5%87%BD%E6%95%B0
分段分组聚合(GROUP BY 子句)
----分日统计
----求时间戳最大的值-求时间戳最小的值
SELECT LAST_VALUE(Q23),FIRST_VALUE(Q23),LAST_VALUE(Q23)-FIRST_VALUE(Q23) from root.ftkj.CY1 group by ([2024-06-20T00:00:00, 2024-06-25T24:00:00),1d)
----求最大值-求最小值
SELECT max_value(Q23) as 最大值,min_value(Q23) as 最小值,max_value(Q23)-min_value(Q23) as 日累 from root.ftkj.CY1 group by ([2024-06-20T00:00:00, 2024-06-25T24:00:00),1d)
1718812800000 72076352 68005968 4070384.0
1718899200000 72103272 72076352 26920.0
1718985600000 74763544 72103272 2660272.0
1719072000000 80110120 74763544 5346576.0
1719158400000 83476328 80110120 3366208.0
1719244800000 86519288 83476328 3042960.0
发表评论