Danny Sullivan
Danny Sullivan

Reputation: 277

Multiple Selects With Influxdb

I am trying to figure out if it's possible to run multiple select statements on influxdb data. I've looked at continuous queries, but am not sure if it's what I need, or if it even makes sense to use them.

I would like to run:

select * from series group by work_id limit 1; 

Then take that data, and run

select * from new_series_from_prior_query where state = 'error'

First question, is this even possible? Second, if not, is there another way to get the desired result using influxdb. Basically I need to filter all work items by their work_id and most recent state. Then, depending on what filters are passed in, check if they match and return that data.

Any help is greatly appreciated. If I cannot get it to work, I will most likely have to switch out the database, would love to stick with influxdb though.

Upvotes: 0

Views: 3293

Answers (1)

Danny Sullivan
Danny Sullivan

Reputation: 277

Influx just released 1.2 today, which has sub queries, that solve this issue.

SELECT * FROM  (select  * from workflows GROUP BY work_id limit 1) WHERE state = 'processed'.

This is what I was looking for.

Upvotes: 3

Related Questions