I'm trying to learn the query language of InfluxDB to create an aggregate table, but I'm having issues. Here is my conundrum. Say I have a table like this:
name: temperature
time | value | metric | measurement
X | 25 | degrees(C) | temperature
X | 10 | degrees(C) | temperature
and one like this
name: cpu_usage
time | metric | value | measurement
X | %usage | 73 | cpu_usage
X | %usage | 75 | cpu_usage
How can I get these into a table like this:
name:aggregate
time | measurement | metric | mean value
X | temperature | degrees(C) | 17.5
X | cpu_usage | %usage | 74
basically, I want to create another table with the mean values from different tables. however, i ALSO want to preserve some of the column names from other tables. Right now, I'm having the issue that you can't mix aggregate and non-aggregate functions, so it won't let me do "SELECT metric, measurement, mean(value) FROM cpu_usage INTO aggregate. And, I have no idea how to merge/join tables (I don't think it's supported anymore), so if i were to calculate the average, store it in a temp table, i wouldn't know how to then combine it with the current tables.