In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-21 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
1) count () function
Returns the number of non-null values in a (field) field.
Syntax:
SELECT COUNT () FROM [WHERE] [GROUP BY]
Example:
> SELECT COUNT (water_level) FROM h3o_feetname: h3o_feet-time count1970-01-01T00:00:00Z 15258
This indicates that the water_level field has 15258 pieces of data in the h3ofeet table.
Note: if the function in InfluxDB does not specify a time, it defaults to epoch 0 (1970-01-01T00:00:00Z).
You can add time conditions to where as follows:
> SELECT COUNT (water_level) FROM h3o_feet WHERE time > = '2015-08-18T00RV 00RV 00Z' AND time
< '2015-09-18T17:00:00Z' GROUP BY time(4d)name: h3o_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() FROM [WHERE ] [GROUP BY ] 使用示例 >SELECT DISTINCT ("level description") FROM h3o_feetname: h3o_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
This example shows that the level description field has four values, and then displays them with the default time.
3) MEAN () function
Returns the arithmetic mean (average) of the values in a field (field). The field type must be a long integer or float64.
Syntax format:
SELECT MEAN () FROM [WHERE] [GROUP BY]
Use the example
> SELECT MEAN (water_level) FROM h3o_feetname: h3o_feet-time mean1970-01-01T00:00:00Z 4.286791371454075
The average value of the water_level field is 4.286791371454075.
Time is the default time, of course, you can also add where conditions.
4) MEDIAN () function
Returns the median value (median) from the sort value in a single field (field). The type of the field value must be a long integer or float64 format.
Syntax:
SELECT MEDIAN () FROM [WHERE] [GROUP BY]
Use the example
> SELECT MEDIAN (water_level) from h3o_feetname: h3o_feet-time median1970-01-01T00:00:00Z 4.124
The median of the water_level field in the specification table is 4.124
5) SPREAD () function
Returns the difference between the minimum and maximum values of a field. The type of data must be long integer or float64.
Syntax:
SELECT SPREAD () FROM [WHERE] [GROUP BY]
Use the example
> SELECT SPREAD (water_level) FROM h3o_feetname: h3o_feet-time spread1970-01-01T00:00:00Z 10.5746) SUM () function
Returns the sum of all values in a field. The field must be of type long integer or float64.
Syntax:
SELECT SUM () FROM [WHERE] [GROUP BY]
Examples of use:
> SELECT SUM (water_level) FROM h3o_feetname: h3o_feet-time sum1970-01-01T00:00:00Z 67777.66900000002
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.