SELECT SomeId, ModifiedUser, MAX(ModifiedDate)
FROM SomeTable
GROUP BY SomeId, ModifiedUser
Then I get results like this:
1000 User1 Mar 30 2011
1000 User2 Jun 25 2011
1001 User3 Mar 21 2011
1001 User4 Jun 20 2011
How do I modify the query so I get only
1000 User2 Jun 25 2011
1001 User4 Jun 20 2011
Basically take the first query results then group by SomeId with latest ModifiedDate and ModifiedUser connected to the latest ModifiedDate
You have to do 2 queries and join them.
1st query:
This singles out the “unique information”. Then, you join that with:
to give you all the data. So, the complete query is: