InfluxDB chooses different time between two lines with the same field value

I have a table like this on InfluxDB: +---------------+-----------------+--------+--------------------------+ | time | sequence_number | action | session_id | +---------------+-----------------+--------+--------------------------+ | 1433322591220 | 270001 | delete | 556d85bfe26c3b3864617605 | | 1433322553324 | 250001 | delete | 556d88e4e26c3b3b83c99d32 | | 1433241828472 | 230001 | create | 556d88e4e26c3b3b83c99d32 | | 1433241023633 | 80001 | create | 556d85bfe26c3b3864617605 | | 1433239305306 | 70001 | create | 556d7f09e26c3b34e872b2ba | +---------------+-----------------+--------+--------------------------+

Now I want to find the time range from the session to be created for deletion, which means get time

where the action=delete

minus time

where action=create

if they have the samesession_id

+3


source to share





All Articles