I have a table which I want to get the latest entry for each group. Here\'s the table:
DocumentStatusLogs Table
DocumentStatusLogs
|ID| DocumentID | Status
SELECT documentid, status, datecreated FROM documentstatuslogs dlogs WHERE status = (SELECT status FROM documentstatuslogs WHERE documentid = dlogs.documentid ORDER BY datecreated DESC LIMIT 1)