I'm trying to retrieve the most recent 2 items from InfluxDB via Nodered for further processing. I can't seem to combine the items and get the last values.
SELECT last(Temperature) FROM environment where Location = '5th_wheel'
but it only returns one value.
This works but gets the oldest readings:
select "Temperature", "Humidity" FROM environment WHERE Location = '5th_wheel' LIMIT 1
This draws an error:
select last("Temperature", "Humidity") FROM environment WHERE Location = '5th_wheel'
"Error: Error from InfluxDB: invalid number of arguments for last, expected 1, got 2"
Not sure if this worked because the timecode is wrong:
select last("Temperature"), last("Humidity") FROM environment WHERE Location = '5th_wheel'
Any idea of what the right query would be??