2

Currently, I cannot do this in CnosQL:

SELECT mean(max("speed")) FROM "wind" GROUP BY time(1m)

I would like to count the average value of the maximum speed per minute over a period of time.

Munin
  • 1,576
  • 2
  • 19

2 Answers2

1

Apparently, CnosDB supports nested subqueries with aggregate functions. You can try with

SELECT MEAN("max") FROM (SELECT MAX("speed") FROM "wind" GROUP BY time(1m) )

You use the wrong syntax of nested subqueries with aggregate functions.

The right syntax is:

SELECT_clause FROM ( SELECT_clause FROM ( SELECT_statement ) [...] ) [...]

Maybe you can try this again.

xmh
  • 125
  • 8
0

I think that it supports. However, your query seems problematic for adding "" for the measurement name. TRY:

SELECT mean(max("speed")) FROM wind GROUP BY time(1m)
Sagar Darekar
  • 982
  • 9
  • 14
lux0106
  • 1
  • 3