Search code examples
influxdbinfluxql

How to escape single quotes in influxDB query


I'm trying to run a command on influxDB using -execute from the cli

influx -execute 'select * from test_measurement where time > \‘2020-01-13T16:22:00Z\’ and time < \‘2020-01-13T16:22:30Z\’ -username uname -password pwd 

The query doesn't run as I'm unable to escape the single quotes(') for time condition. Can someone help with the syntax please.


Solution

  • Could you try:

    influx -execute "select * from test_measurement where time > '2020-01-13T16:22:00Z' and time < '2020-01-13T16:22:30Z'" -username uname -password pwd