我有一个 influxDB ,testdb
我正在尝试对具有fieldtype
不同.fieldType
fieldType
设置
> 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"
现在我有 4 个测量值,即 , rpm
, load
, 。他们是:mode
execution
fieldType
> 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
我可以做什么
我能够从多个相同的测量中成功获得结果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
问题
我无法将所有 4 个测量值合并到一个查询中。下面的查询应该返回所有 4 个测量的结果,而不是只返回float
类型的结果。
> select last(data) from mode, execution, rpm, load
name: load
time last
---- ----
1564000155650446100 89
name: rpm
time last
---- ----
1564000155620293100 300
如果我更改顺序,我会得到相同的结果:
> select last(data) from rpm, load, mode, execution
name: load
time last
---- ----
1564000155650446100 89
name: rpm
time last
---- ----
1564000155620293100 300
有没有办法让我获得结果string
并float
输入一个结果集?