I have a large data-set of emails sent and status-codes.
ID Recipient Date Status
1 someone@example.com 01/01/2010 1
2 someone@example.com
You cannot easily do this is a single query because count(*) is a group function whereas the latest status comes from a specific row. Here is the query to get the latest status for each user:
SELECT M.Recipient, M.Status FROM Messages M
WHERE M.Date = (SELECT MAX(SUB.Date) FROM MESSAGES SUB
WHERE SUB.Recipient = M.Recipient)