You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
初始化数据如下:
insert into root.ln.wf01.wt01(timestamp,temp1)values(0,21);
insert into root.ln.wf01.wt01(timestamp,temp1)values(3600000,22);
insert into root.ln.wf01.wt01(timestamp,temp2)values(0,23);
insert into root.ln.wf01.wt01(timestamp,temp2)values(3600000,24);
insert into root.ln.wf01.wt02(timestamp,temp1)values(0,25);
insert into root.ln.wf01.wt02(timestamp,temp1)values(3600000,26);
insert into root.ln.wf01.wt02(timestamp,temp2)values(0,27);
insert into root.ln.wf01.wt02(timestamp,temp2)values(3600000,28);
insert into root.ln.wf01.wt03(timestamp,temp1)values(0,29);
insert into root.ln.wf01.wt03(timestamp,temp1)values(3600000,30);
insert into root.ln.wf01.wt03(timestamp,temp2)values(0,31);
insert into root.ln.wf01.wt03(timestamp,temp2)values(3600000,32);
查询sql:
select avg(temp1) from root.ln.wf01.wt03, root.ln.wf01.wt01 group by ([1970-01-01T08:00:00,1970-01-01T10:00:00),1h),level=2
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
初始化数据如下:
insert into root.ln.wf01.wt01(timestamp,temp1)values(0,21);
insert into root.ln.wf01.wt01(timestamp,temp1)values(3600000,22);
insert into root.ln.wf01.wt01(timestamp,temp2)values(0,23);
insert into root.ln.wf01.wt01(timestamp,temp2)values(3600000,24);
insert into root.ln.wf01.wt02(timestamp,temp1)values(0,25);
insert into root.ln.wf01.wt02(timestamp,temp1)values(3600000,26);
insert into root.ln.wf01.wt02(timestamp,temp2)values(0,27);
insert into root.ln.wf01.wt02(timestamp,temp2)values(3600000,28);
insert into root.ln.wf01.wt03(timestamp,temp1)values(0,29);
insert into root.ln.wf01.wt03(timestamp,temp1)values(3600000,30);
insert into root.ln.wf01.wt03(timestamp,temp2)values(0,31);
insert into root.ln.wf01.wt03(timestamp,temp2)values(3600000,32);
查询sql:
select avg(temp1) from root.ln.wf01.wt03, root.ln.wf01.wt01 group by ([1970-01-01T08:00:00,1970-01-01T10:00:00),1h),level=2
结果错误:
+-------------------------------+------------------------+------------------------+
| Time |avg(root..wf01..temp1)|avg(root..wf01..temp1)|
+-------------------------------+------------------------+------------------------+
|1970-01-01T08:00:00.000+08:00 | 25.0 | 25.0 |
|1970-01-01T09:00:00.000+08:00 | 26.0 | 26.0 |
+-------------------------------+------------------------+------------------------+
因为产生了两列完全相同的结果
但是如果我用sql:
select avg(temp1) from root.ln.wf01.* group by ([1970-01-01T08:00:00,1970-01-01T10:00:00),1h),level=2
结果就是正确的
+-----------------------------+------------------------+
| Time |avg(root..wf01..temp1) |
+-----------------------------+------------------------+
|1970-01-01T08:00:00.000+08:00| 25.0 |
|1970-01-01T09:00:00.000+08:00| 26.0 |
+-----------------------------+------------------------+
我的应用场景是:我有多个设备,但是我需要对其中部分设备进行汇总,所以不能用通配符来实现,应该如何做到呢?
Beta Was this translation helpful? Give feedback.
All reactions