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

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3ba15-2c2c6.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3ba15-2c2c6.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?