Hi. I have a table similar to this where MyUID is unique. I need to locate rows which are unique on the last 3 columns and then pick the row with the most recent DateTime. So the result of the query is the next table. Does any one know how to write such a query?
Data In table | ||||
MyUID | DateTime | TypeID | ManueverID | MyBool |
1 | 6/30/2014 | 1 | 1 | 1 |
2 | 6/29/2014 | 1 | 1 | 1 |
3 | 7/4/2014 | 1 | 1 | 0 |
4 | 6/25/2014 | 1 | 2 | 1 |
5 | 7/10/2014 | 1 | 2 | 0 |
6 | 6/26/2014 | 2 | 1 | 0 |
7 | 7/8/2014 | 2 | 1 | 1 |
8 | 6/25/2014 | 2 | 1 | 0 |
9 | 7/19/2014 | 2 | 2 | 1 |
10 | 7/2/2014 | 2 | 2 | 1 |
Result of query | ||||
MyUID | DateTime | TypeID | ManueverID | MyBool |
1 | 6/30/2014 | 1 | 1 | 1 |
3 | 7/4/2014 | 1 | 1 | 0 |
4 | 6/25/2014 | 1 | 2 | 1 |
5 | 7/10/2014 | 1 | 2 | 0 |
6 | 6/26/2014 | 2 | 1 | 0 |
7 | 7/8/2014 | 2 | 1 | 1 |
9 | 7/19/2014 | 2 | 2 | 1 |