Influxdb 如何在XDB查询中转义单引号

Influxdb 如何在XDB查询中转义单引号,influxdb,influxql,Influxdb,Influxql,我正在尝试使用cli中的-execute在XDB上运行命令 influx -execute 'select * from test_measurement where time > \‘2020-01-13T16:22:00Z\’ and time < \‘2020-01-13T16:22:30Z\’ -username uname -password pwd inflow-执行“从测试测量中选择*,其中时间>\'2020-01-13T16:22:00Z\'和时间>\'2020-

我正在尝试使用cli中的-execute在XDB上运行命令

influx -execute 'select * from test_measurement where time > \‘2020-01-13T16:22:00Z\’ and time < \‘2020-01-13T16:22:30Z\’ -username uname -password pwd 
inflow-执行“从测试测量中选择*,其中时间>\'2020-01-13T16:22:00Z\'和时间>\'2020-01-13T16:22:30Z\'-用户名uname-密码pwd
查询没有运行,因为我无法为时间条件转义单引号(')。有人能帮我解释一下语法吗。

你能试试吗:

influx -execute "select * from test_measurement where time > '2020-01-13T16:22:00Z' and time < '2020-01-13T16:22:30Z'" -username uname -password pwd 
inflow-执行“从测试中选择*”,其中时间>2020-01-13T16:22:00Z”,时间<'2020-01-13T16:22:30Z'-用户名uname-密码pwd
时间>'date str'

无法在influx cli中工作,因为这不是字符串字段的有效运算符。。。我认为您需要一个纳秒形式的数值,或者不管db实例的精度如何

对于字符串字段,可以使用正则表达式匹配,如

=~/2020-01-*/

例如,2020年1月的所有比赛