You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It took me a long time to figure out where the "sum" field came after I migrated data.
Right now I have a measurement that is stored in a field named "sum" (automatically generated by a CQ). I need to copy that data into a field named "value". the syntax "SELECT field AS whatever" does not work, it only seems to work when a function is involved.
My goal is to run the following query and have the field "sum" renamed to "value".
SELECT "sum" AS "value" INTO l1.connected_clients_by_region_sum FROM "default"."connected.clients.by.region" WHERE time >= '2016-02-07T05:00:00Z' AND time < '2016-02-07T06:00:00Z' GROUP BY * fill(none)
Influxdb version 0.9.6.1+dfsg1-4, I did not see any notice that this beheaviour changed in 0.10, so I assume it's still current.
> SELECT sum(value) AS "value" FROM freifunk.l1.connected_clients WHERE time >= '2016-02-13T13:58:00Z' AND time < '2016-02-13T13:59:00Z' GROUP BY time(1m), region fill(none)
name: connected_clients
tags: region=ffhh
time value
---- -----
1455371880 2150
name: connected_clients
tags: region=ffpi
time value
---- -----
1455371880 254
> SELECT "sum" AS "value" FROM "default"."connected.clients.by.region" WHERE time >= '2016-02-07T05:00:00Z' AND time < '2016-02-07T06:00:00Z' GROUP BY * fill(none) LIMIT 5
name: connected.clients.by.region
tags: region=ffhh
time sum
---- ---
1454821200 1116
1454821260 1115
1454821320 1140
1454821380 1148
1454821440 1162
name: connected.clients.by.region
tags: region=ffpi
time sum
---- ---
1454821200 186
1454821260 186
1454821320 188
1454821380 187
1454821440 18
The text was updated successfully, but these errors were encountered:
SELECT mean("sum") AS "value" FROM "default"."connected.clients.by.region" WHERE time >= '2016-02-07T05:00:00Z' AND time < '2016-02-07T06:00:00Z' GROUP BY time(1m), * fill(none) LIMIT 5
name: connected.clients.by.region
the GROUP BY time(1m) must be chosen to never aggregate two values... it depends on the data.
> insert cpu,host=server01 value=3
> insert cpu,host=server02 value=5
> select sum(value) as value from cpu group by *
name: cpu
tags: host=server01
time value
---- -----
0 3
name: cpu
tags: host=server02
time value
---- -----
0 5
It took me a long time to figure out where the "sum" field came after I migrated data.
Right now I have a measurement that is stored in a field named "sum" (automatically generated by a CQ). I need to copy that data into a field named "value". the syntax "SELECT field AS whatever" does not work, it only seems to work when a function is involved.
My goal is to run the following query and have the field "sum" renamed to "value".
Influxdb version 0.9.6.1+dfsg1-4, I did not see any notice that this beheaviour changed in 0.10, so I assume it's still current.
The text was updated successfully, but these errors were encountered: