September 2018
Intermediate to advanced
412 pages
11h 12m
English
The GROUP BY clause groups query results based on a user-specified set of tags or a time interval. This example is for the InfluxQL function calculating the average water_level for each tag value of location in the h2o_feet measurement. The returned results are grouped into two series—one for each tag value of location:
> SELECT MEAN("water_level") FROM "h2o_feet" GROUP BY "location"name: h2o_feettags: location=coyote_creektime mean---- ----1970-01-01T00:00:00Z 5.359342451341401name: h2o_feettags: location=santa_monicatime mean---- ----1970-01-01T00:00:00Z 3.530863470081006