如果InfluxDB中没有数据,如何删除返回零的时间戳

时间:2017-12-05 09:51:40

标签: database influxdb

我的InfluxDB查询是:

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

Ouput

我们如何放弃零?

1 个答案:

答案 0 :(得分:0)

来自InfluxDB docs

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

要为没有数据的时间间隔不返回时间戳,请使用select count(quantity) from test where time > now()-10d group by time(1d) fill(none)

POST http://localhost:9080/rest/document/createAttachmentByFormData?docId=421 HTTP/1.1
Host: localhost:9080
Connection: keep-alive
Content-Length: 2806029
Cache-Control: max-age=0
Origin: http://localhost:9080
Upgrade-Insecure-Requests: 1
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryYtXkHtK8fLnpK8AO
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
Accept-Encoding: gzip, deflate, br
Accept-Language: en-US,en;q=0.9

Some Text
------WebKitFormBoundaryYtXkHtK8fLnpK8AO
Content-Disposition: form-data; name="textfield-1226-inputEl"

ATTACHMENT
------WebKitFormBoundaryYtXkHtK8fLnpK8AO
Content-Disposition: form-data; name="thefile"; filename="somefile.pdf"
Content-Type: application/pdf