Group by day creates a aggregate function error


I am new to graphana and my background is more in MySQL. I want to sum my datapoints (in seconds ) throughout a day and give the result in hours

SELECT “sum(duration) / 3600” as S FROM “_MyPoints” WHERE (“duration_unit” = ‘s’) AND $timeFilter GROUP BY time(1d)

All my variables exist because i already have a graph showing the durations according to time. i just want to group them by 1 day . I get a :InfluxDB Error: GROUP BY requires at least one aggregate function

is there something basic missing here???

thank you if you can point me in the right direction

Welcome to the Grafana (not Graphana) forum ; )

The InfluxQL syntax you have shown does not look correct. The aggregate function would normally be just after the SELECT statement (such as first, last, mean, etc).
Maybe this?

SELECT last("sum(duration)/3600") as S FROM ....