Hi everyone! I got a MySQL table of logs. It has the following fields: id, status_id, object_id, created, modified.
I'm wondering what's the best way to get the latest status for each object?
Thanks in advance!
Edit: My last solution was to do
SELECT id, status_id, object_id, created, modified
FROM (SELECT * FROM logs ORDER BY created DESC) AS a
GROUP BY object_id
It works but I think there's a better way of doing this. Anyone care to enlighten us here at SO? :)