Example – calculate the mean field value associated with a field key

The MEAN(*) function returns the arithmetic mean (average) of field values:

> SELECT MEAN("water_level") FROM "h2o_feet"  name: h2o_feet time                   mean ----                   ---- 1970-01-01T00:00:00Z   4.442107025822522

The output is the average field value for the water_level field key in the h2o_feet measurement.

For more examples and detailed information, go to https://docs.influxdata.com/influxdb/v1.2/query_language/functions/.

Get Industrial Internet Application Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.