【问题标题】:How to drop timestamps that return zero if there is no data in InfluxDB如果 InfluxDB 中没有数据,如何删除返回零的时间戳
【发布时间】:2017-12-05 09:51:40
【问题描述】:

我的 InfluxDB 查询是:

select count(quantity) from test group by time(1d)

Ouput

我们如何降零?

【问题讨论】:

    标签: database influxdb


    【解决方案1】:

    来自InfluxDB docs

    fill() 更改没有数据的时间间隔报告的值。

    要为没有数据的间隔返回不时间戳,请使用fill(none)

    select count(quantity) from test where time > now()-10d group by time(1d) fill(none)
    

    【讨论】:

    • @lalitbhadouria 如果没有fill(none),它会返回什么?您可能需要更改where 条件...
    • fill(none) 应该删除 count == 0 的那些...您现在正在运行的 exact 查询是什么?
    猜你喜欢
    • 2022-09-23
    • 1970-01-01
    • 1970-01-01
    • 2023-01-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多