I am trying to run a dashboard with influxdb and grafana and i would like to show only the latest values of each id
e.g. if i have a table something like this
id | utime |
---|---|
2 | 9:10AM |
3 | 9:20AM |
2 | 9:30AM |
2 | 9:35AM |
4 | 9:40AM |
4 | 9:50AM |
Now I would like to create a query in which it will only show me the latest result of each id
and the result will show something like this below..
| 2 | 9:35AM |
| 3 | 9:20AM |
| 4 | 9:50AM |
I am new to this and don't know how exactly will it work. I have tried this query below but it didn't worked.
SELECT "id", "utime" FROM "http_listener_v2" WHERE $timeFilter GROUP BY "id"
Can somebody please help,how can I do this?