Skip to content

关于连续查询的一些问题 #10653

Answered by JackieTien97
StrongManLi asked this question in Q&A
Discussion options

You must be logged in to vote
  1. 第一个问题你可以试着加上group by clause
  2. 第二个问题,where里是不能对聚合结果进行过滤的,必须用having子句进行过滤,比如说 select sum(s1) as sum_alias from root.db.d1 having sum_alias > 1, 你可以参考官网https://iotdb.apache.org/zh/UserGuide/V1.1.x/Query-Data/Having-Condition.html;
  3. 可以的,create CQ hourly resample every 5m RANGE 1h boundary 2023-07-07T00:00:00 begin select sum(temperature) into root.hourly.:: (temperature) from root.a.b.* group by(1h) align by device end你也可以参考官网文档 https://iotdb.apache.org/zh/UserGuide/V1.1.x/Query-Data/Continuous-Query.html#%E8%BF%9E%E7%BB%AD%E6%9F%A5%E8%AF%A2%E7%9A%84%E7%94%A8%E4%BE%8B

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@StrongManLi
Comment options

Answer selected by JackieTien97
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants