Order of items in the group by clause is irrelevant.

On Thu, Oct 27, 2016 at 3:11 AM, <[email protected]> wrote:

> Op donderdag 27 oktober 2016 10:15:34 UTC+2 schreef [email protected]:
> > Hi all,
> >
> > Let's say we have a measurement "storage/free" which has a tag "host"
> and I want to have a single value which shows summarized value of free
> space among all hosts.
> >
> > If I run this I get average among all hosts:
> > SELECT mean("value") FROM "storage/free" WHERE time > now() - 1d GROUP
> BY time(1d)
> >
> > If I run this I get multiple values (one per host) as a result:
> > SELECT mean("value") FROM "storage/free" WHERE time > now() - 1d GROUP
> BY time(1d), host
> >
> > Could anybody tell me if it is possible to get a single value which
> would be the sum for all hosts?
> >
> > Regards,
> > Stanislav
>
> Hey,
>
> Not sure if this could be a solution. It's the first thing to come to my
> mind. Switch the group by order.
>
> So instead of : GROUP BY time(1d), host
> try GROUP BY host, time(1d)
>
> I hope this will solve your problem
>
> --
> Remember to include the version number!
> ---
> You received this message because you are subscribed to the Google Groups
> "InfluxData" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/influxdb.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/influxdb/be0bcd0a-db3f-4ed7-91eb-8afb17e791d4%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Sean Beckett
Director of Support and Professional Services
InfluxDB

-- 
Remember to include the version number!
--- 
You received this message because you are subscribed to the Google Groups 
"InfluxData" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/influxdb.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/influxdb/CALGqCvNPKXvnEAtJ-GycGE4g%2BG_T-KoSLg2%3D60CbfsLo6jw_Zw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to