I’m working on a projekt with Kapacitor and InfluxDB. i have to compare the two last values enterred into the database. for that a build two query. The first return the last element. that is easy.
The second is the folowing : SELECT * FROM temperature_cuisine ORDER BY time desc limit 1 offset 1
this one return the second last element.
How can i use ORDER BY … DESC LIMIT … OFFSET with kapacitor ? I’ve find some response but only for GROUP By…
anybody as an idea ?
Thank’s for help!
code of the query :
var secondLastValue = batch |query(''' SELECT * as oldTemperature FROM "mayen"."autogen"."temperature_cuisine" ORDER BY time desc limit 1 offset 1 ''') .period(1s) .every(1s)