Apache IoTDB统计某个路径下字段总数的语法是否可以添加时间条件?我尝试了命令
count TIMESERIES root.OLC
,这个查询执行成功,但是当我尝试count TIMESERIES root.OLC WHERE time >= NOW() -10h and time <= now()
时,这个查询执行失败。该查询的错误信息为700: Error occurred while parsing SQL to physical plan: line 1:59 mismatched input 'time' expecting
,提示time
关键字不正确。如果我需要在这种查询中添加时间条件,我该如何编写查询语句呢?
该功能预计在 Apache IoTDB 1.3.3 版本中实现。现在,您可以执行
select last_value(s1) from root.OLC.** where time >= now() - 10h and time <= now() having last_value(s1) is not null align by device
命令,然后计算返回的行数,这应该是您需要的字段总数。