WebsterTrivium
Programmer
I'm trying to build a query to return the row with the most recent timestamp for each device in a table. Currently I have this:
Which simply returns the first row for each device (Or at least, that's what it looks like). The timestamp is simply an int with the Unix Epoch timestamp. deviceID is a string that stores the name of each device.
Any help is greatly appreciated!
Code:
SELECT (Fields)
FROM (Database)
WHERE (Conditions)
GROUP BY deviceID
HAVING MAX(timestamp);
Which simply returns the first row for each device (Or at least, that's what it looks like). The timestamp is simply an int with the Unix Epoch timestamp. deviceID is a string that stores the name of each device.
Any help is greatly appreciated!