InfluxDB?????????InfluxDB????????????????????????????????????

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了InfluxDB?????????InfluxDB????????????????????????????????????相关的知识,希望对你有一定的参考价值。

?????????sum

1???count()??????

???????????????field????????????????????????????????????

?????????

SELECT COUNT(<field_key>) FROM <measurement_name> [WHERE <stuff>] [GROUP BY <stuff>]

?????????

>SELECT COUNT(water_level) FROM h2o_feet
name: h2o_feet--------------time                           count1970-01-01T00:00:00Z     15258

?????? water_level??????????????? h2o_feet????????????15258????????????

?????????InfluxDB????????????????????????????????????????????????????????? epoch 0 (1970-01-01T00:00:00Z) ???????????????

?????????where ?????????????????????????????????

> SELECT COUNT(water_level) FROM h2o_feet WHERE time >= ???2015-08-18T00:00:00Z??? AND time < ???2015-09-18T17:00:00Z??? GROUP BY time(4d)
name: h2o_feet--------------time                           count2015-08-17T00:00:00Z     14402015-08-21T00:00:00Z     19202015-08-25T00:00:00Z     19202015-08-29T00:00:00Z     19202015-09-02T00:00:00Z     19152015-09-06T00:00:00Z     19202015-09-10T00:00:00Z     19202015-09-14T00:00:00Z     19202015-09-18T00:00:00Z     335

???????????????????????????????????????

2???DISTINCT()??????

?????????????????????field??????????????????

?????????

SELECT DISTINCT(<field_key>) FROM <measurement_name> [WHERE <stuff>] [GROUP BY <stuff>]

????????????

> SELECT DISTINCT("level description") FROM h2o_feet
name: h2o_feet--------------time                           distinct1970-01-01T00:00:00Z     between 6 and 9 feet1970-01-01T00:00:00Z     below 3 feet1970-01-01T00:00:00Z     between 3 and 6 feet1970-01-01T00:00:00Z     at or greater than 9 feet

??????????????????level description????????????????????????????????????????????????????????????????????????????????????

3???MEAN() ??????

?????????????????????field?????????????????????????????????????????????????????????????????????????????????float64???

???????????????

SELECT MEAN(<field_key>) FROM <measurement_name> [WHERE <stuff>] [GROUP BY <stuff>]

????????????

> SELECT MEAN(water_level) FROM h2o_feet
name: h2o_feet--------------time                           mean1970-01-01T00:00:00Z     4.286791371454075

??????water_level?????????????????????4.286791371454075

???????????????????????????????????????????????????where?????????

4???MEDIAN()??????

??????????????????field??????????????????????????????????????????????????????????????????????????????????????????float64?????????

?????????

SELECT MEDIAN(<field_key>) FROM <measurement_name> [WHERE <stuff>] [GROUP BY <stuff>]

????????????

> SELECT MEDIAN(water_level) from h2o_feet
name: h2o_feet--------------time                           median1970-01-01T00:00:00Z     4.124

???????????? water_level????????????????????? 4.124

5???SPREAD()??????

??????????????????????????????????????????????????????????????????????????????????????????float64???

?????????

SELECT SPREAD(<field_key>) FROM <measurement_name> [WHERE <stuff>] [GROUP BY <stuff>]

????????????

> SELECT SPREAD(water_level) FROM h2o_feet
name: h2o_feet--------------time                            spread1970-01-01T00:00:00Z      10.574

6???SUM()??????

??????????????????????????????????????????????????????????????????????????????float64???

?????????

SELECT SUM(<field_key>) FROM <measurement_name> [WHERE <stuff>] [GROUP BY <stuff>]

???????????????

> SELECT SUM(water_level) FROM h2o_feet
name: h2o_feet--------------time                           sum1970-01-01T00:00:00Z     67777.66900000002


???????????? ???DBSpace??? ?????????????????????????????????http://dbspace.blog.51cto.com/6873717/1880954

以上是关于InfluxDB?????????InfluxDB????????????????????????????????????的主要内容,如果未能解决你的问题,请参考以下文章

influxDB 基础了解

InfluxDB学习之InfluxDB的安装和简介

5,6,7_InfluxDB数据保留策略,InfluxDB的关键概念,带有时区进行查询示例

如何导出influxdb的数据

influxdb filed最大存多少数据

InfluxDB学习之InfluxDB数据保留策略(Retention Policies)