InfluxQL:名为 Group 的标签引起了悲伤
InfluxQL: tag called Group causing grief
我必须使用 influxDB 数据库,其中一个标签称为组。例如查询 select * from Testing limit 10
returns
time Expiry Group Parameter Type value
---- ------ ----- --------- ---- -----
1623325196515 2021-06-18 GA011 Aleft Combined -21.739
1623325196515 2021-06-18 GA011 Aright Combined 0.933
1623325196515 2021-06-18 GA011 Bleft Combined 43.097
1623325196515 2021-06-18 GA011 Bright Combined 2.582
1623325196515 2021-06-18 GA011 Cleft Combined 24.841
1623325196515 2021-06-18 GA011 Cright Combined -3.444
1623325196515 2021-06-18 GA011 Dleft Combined 12.012
1623325196515 2021-06-18 GA011 Dright Combined 2.574
1623325196515 2021-06-18 GA011 Eleft Combined 1.232
1623325196515 2021-06-18 GA011 Eright Combined 15.764
问题是当我尝试使用基于组的规则时,例如
select * from Testing where Group='GA011'
我收到一条错误消息
ERR: error parsing query: found GROUP, expected identifier, string, number, bool at line 1, char 29.
基本上它将 Group
视为函数而不是标签。有什么办法可以把关键字Group
转义出来查询数据库
PS。我不需要对设计做任何事情,现在无法更改。
你可以用双引号转义:
select * from Testing where "Group"='GA011'
我必须使用 influxDB 数据库,其中一个标签称为组。例如查询 select * from Testing limit 10
returns
time Expiry Group Parameter Type value
---- ------ ----- --------- ---- -----
1623325196515 2021-06-18 GA011 Aleft Combined -21.739
1623325196515 2021-06-18 GA011 Aright Combined 0.933
1623325196515 2021-06-18 GA011 Bleft Combined 43.097
1623325196515 2021-06-18 GA011 Bright Combined 2.582
1623325196515 2021-06-18 GA011 Cleft Combined 24.841
1623325196515 2021-06-18 GA011 Cright Combined -3.444
1623325196515 2021-06-18 GA011 Dleft Combined 12.012
1623325196515 2021-06-18 GA011 Dright Combined 2.574
1623325196515 2021-06-18 GA011 Eleft Combined 1.232
1623325196515 2021-06-18 GA011 Eright Combined 15.764
问题是当我尝试使用基于组的规则时,例如
select * from Testing where Group='GA011'
我收到一条错误消息
ERR: error parsing query: found GROUP, expected identifier, string, number, bool at line 1, char 29.
基本上它将 Group
视为函数而不是标签。有什么办法可以把关键字Group
转义出来查询数据库
PS。我不需要对设计做任何事情,现在无法更改。
你可以用双引号转义:
select * from Testing where "Group"='GA011'