How does influxDB count the same field entry data with CQs?

data of measurement

data of a measurement. Field is age
clipboard.png

.

Target:

write a CQs that aggregates the data according to the specified time (group by time ())
logic: count the point of the same age

example:

count the point of age=14 and age=132 in the data shown above, and the result after CQs is:

time age count
     14    3
     132   2
      .
      .
      .

is there any way?

Jun.14,2022

is temporarily divided into groups, but the format is not ideal

Menu