1

In InfluxDB, how can I create a list of strings/values by using a "SELECT" statement or any other "query" ?

My question is same as this question: mysql fake select
But, for Influxdb.

I'm using latest version of InfluxDB which is 1.2.4

kmonsoor
  • 7,600
  • 7
  • 41
  • 55

1 Answers1

1

As of now , there is no IN operator support in influxdb .

Lets say I want to run the query like this -

 select value from measurement where key in ('903','965' ,'890') group by key limit 10 offset 0;

this can be done in a way like these -

OR

 select value from measurement where key='903' or key='965' or key='890' group by key limit 10 offset 0;

Regex

 select value from measurement where key=~ /^903$|^965$|^890$/ group by key limit 10 offset 0;

However, the above way is unindexed , so I will update my answer once influxdb start supporting IN operator .

Let me know , if this way around does not work for you and I will try to update it .

tom
  • 3,720
  • 5
  • 26
  • 48
  • 1
    this what I was looking for initially it was working as 'like' operator , but after adding ^ $ gives the correct result. – Rahul Shukla Sep 07 '21 at 10:52