Let's say I have a table:
Name, status, timestamp
And I want to select the rows that match status='active' but only those that have the most recent timestamp for each of them. So if there were rows like this:
Bob, active, 5/10/2010
Bob, active, 6/12/2010
Ann, inactive, 6/12/2000
Ann, active, 9/3/2009
Ann, active, 9/25/2010
I'd want it to return:
Bob, active, 6/12/2010
Ann, active, 9/25/2010
How can I do this? I'm using SQLite, if it matters.
Thank you.