Hi folks,
I'm trying to write a query that returns the latest row per ID. This works to an extent:
SELECT
MAX(__time),
ID,
Status,
FROM table
It returns something similar to this:
__time, ID, Status
08:31, 001, SUCCESS
08:30, 001, RUNNING
08:31, 002, RUNNING
08:31, 003, RUNNING
08:29, 004, FAILED
08:28, 004, RUNNING
It returns the latest row per ID & Status.
How do I write the query so that it returns the latest row per ID, regardless of the status (or any other column for that matter)?
__time, ID, Status
08:31, 001, SUCCESS
08:31, 002, RUNNING
08:31, 003, RUNNING
08:29, 004, FAILED
Thanks,
Floyd