I have an influxDB testdb
where, I am trying a SELECT query on 4 different measurements with different fieldtype
.I am able to query more than measurements successfully but when it comes to combining multiple measurements with different fieldType
, influxDB only returns results for one fieldType
.
Setup
> create database testdb
> use testdb
Using database testdb
> insert rpm,path=P1 data=200
> insert rpm,path=P2 data=100
> insert rpm,path=P1 data=300
>
> insert load,path=P1 data=77
> insert load,path=P1 data=89
>
> insert mode,path=P1 data="AUTOMATIC"
> insert mode,path=P2 data="MANUAL"
> insert mode,path=P1 data="AUTOMATIC"
>
> insert execution,path=P1 data="ACTIVE"
Now I have 4 measurements namely, rpm
, load
, mode
, execution
. Their fieldType
are:
> show field keys on testdb
name: execution
fieldKey fieldType
-------- ---------
data string
name: load
fieldKey fieldType
-------- ---------
data float
name: mode
fieldKey fieldType
-------- ---------
data string
name: rpm
fieldKey fieldType
-------- ---------
data float
What I can do
I am able to get results successfully from mode than one measurements of same fieldType
.
> select last(data) from mode, execution
name: execution
time last
---- ----
1564000155710480300 ACTIVE
name: mode
time last
---- ----
1564000155694460700 AUTOMATIC
>
> select last(data) from rpm, load
name: load
time last
---- ----
1564000155650446100 89
name: rpm
time last
---- ----
1564000155620293100 300
Problem
I am not able to combine all 4 measurements into one single query. the below query should return results for all 4 measurements, instead it returns results for only float
type.
> select last(data) from mode, execution, rpm, load
name: load
time last
---- ----
1564000155650446100 89
name: rpm
time last
---- ----
1564000155620293100 300
If I change the order, I get the same result:
> select last(data) from rpm, load, mode, execution
name: load
time last
---- ----
1564000155650446100 89
name: rpm
time last
---- ----
1564000155620293100 300
Is there a way so that I can get the result for string
and float
type in one result set?