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
select
time ,
min(cast(pressure as float)) as min_pr,
num
from iot.device_property_20015 where time >= '2024-08-30' and time < '2024-09-04'
partition by num interval(10m) FILL(none)
limit 100
正确的
改成
select
time ,
min(cast(pressure as float)) as min_pr,
max(cast(pressure as float)) as max_pr,
num
from iot.device_property_20015 where time >= '2024-08-30' and time < '2024-09-04'
partition by num interval(10m) FILL(none)
limit 100
错误:
] 错误: Internal error: Invalid usage of expr: time 全部: 19ms
The text was updated successfully, but these errors were encountered:
select time , min(cast(pressure as float)) as min_pr, min(cast(pressure as float)) as min_pr1, num from iot.device_property_20015 where time >= '2024-08-30' and time < '2024-09-04' partition by num interval(10m) FILL(none) limit 100
错误: Internal error: Invalid usage of expr: time 全部: 19ms
首先,min/max 这种函数根据官网的定义来说是选择函数,参见。如果你把 min/max 换成定义上的聚合函数比如 count 时,无论有几个函数都会报错。
其次,当只有一个选择函数时,select list 中的 time 是被当作选择函数返回的列处理的,也就是说这里 select 的 time 是对应着 min(pressure) 那一行的 time,所以此时不会报错。
当有两个选择函数时,time 就无法被当作是选择函数返回的列,这时候使用的规则是 group by 对于 select list 的约束,参见,因为 time 列没有出现在 group by 子句中,所以会报错
select
time ,
min(cast(pressure as float)) as min_pr,
num
from iot.device_property_20015 where time >= '2024-08-30' and time < '2024-09-04'
partition by num interval(10m) FILL(none)
limit 100
正确的
改成
select
time ,
min(cast(pressure as float)) as min_pr,
max(cast(pressure as float)) as max_pr,
num
from iot.device_property_20015 where time >= '2024-08-30' and time < '2024-09-04'
partition by num interval(10m) FILL(none)
limit 100
错误:
] 错误: Internal error:
Invalid usage of expr: time
全部: 19msThe text was updated successfully, but these errors were encountered: