流计算语法问题

【TDengine 使用环境】
生产环境 /测试/ Poc/预生产环境

测试

【TDengine 版本】

3.3.8.1

【操作系统以及版本】

centos7

【部署方式】容器/非容器部署

容器

【集群节点数】

【集群副本数】

【描述业务影响】

【问题复现路径/shan】做过哪些操作出现的问题

我这个设备可能被多个人同时使用我想统计,比如这个温度计可能同时被a,b,c人使用,我想统计每个人平均温度

【遇到的问题:问题现象及影响】

提示语法错误

【资源配置】

【报错完整截图】

%%tbname前面不用加数据库名称。

create stream if not exists lute_iot_device.t31_daily_stats_stream_min_max_avg_llll interval(1d) sliding (1d)
from
lute_iot_device.product_property_3yhuya
partition by tbname stream_options (watermark (2m) | fill_history (1)) into lute_iot_device.t31_daily_stats_987 output_subtable (concat(‘t31_daily_sub_8888’,lower(tbname)))
select
_twstart,
now() as calculate_time,
_twend,
round(avg(temperature), 2) as avg_temperature,
max(
case
when identifier = ‘high_temperature_alarm’ then temperature
else null
end
) as max_temperature,
min(
case
when identifier = ‘low_temperature_alarm’ then temperature
else null
end
) as min_temperature,
device_name,
uid
from
%%tbname where ts >=_twstart and ts<=_twend partition by device_name,uid;如果我想指定输出的超级表device_name为tag字段提示错误我是不是只能partition by 设备了