You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to write a query that only returns the time of the last value for a given series. e.g.
SELECT time
FROM temperature
WHERE time > now() - 1d
GROUP BY deviceId
ORDER BY time DESC
LIMIT 1
Barring the fact that ORDER BY time DESC doesn't work (#4861), InfluxDB also refuses to execute a query that only returns time (not, say, value).
My use case for this is building an alerting system that will tell you if a sensor stops reporting data. The above query should return the timestamp of the latest data point for any sensor that has reported data in the last day, grouped by sensor ID.
It's possible to get around this limitation by querying the data directly (SELECT value), but it doesn't seem like it ought to be necessary.
The text was updated successfully, but these errors were encountered:
and not just for the LIMIT 1 case - my application sometimes needs to know times but not values for a series, and this would I assume cut down the communication overhead a bit
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically closed because it has not had recent activity. Please reopen if this issue is still important to you. Thank you for your contributions.
I'd like to write a query that only returns the time of the last value for a given series. e.g.
Barring the fact that
ORDER BY time DESC
doesn't work (#4861), InfluxDB also refuses to execute a query that only returnstime
(not, say,value
).My use case for this is building an alerting system that will tell you if a sensor stops reporting data. The above query should return the timestamp of the latest data point for any sensor that has reported data in the last day, grouped by sensor ID.
It's possible to get around this limitation by querying the data directly (
SELECT value
), but it doesn't seem like it ought to be necessary.The text was updated successfully, but these errors were encountered: