SQL query for select distinct with most recent timestamp first
- by Josh
I have a mysql table with three columns: username, location, timestamp. This is basically a log of user activity of what location they are in and the time that they were there.
What I want to do is select a distinct username+location where only the most recent item (by timestamp) is provided.
So say the table consists of:
tom roomone 2011-3-25…