Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

SQL group by query to return more than just group by columns

$
0
0

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
MyUIDDateTimeTypeIDManueverIDMyBool
16/30/2014111
26/29/2014111
37/4/2014110
46/25/2014121
57/10/2014120
66/26/2014210
77/8/2014211
86/25/2014210
97/19/2014221
107/2/2014221
Result of query
MyUIDDateTimeTypeIDManueverIDMyBool
16/30/2014111
37/4/2014110
46/25/2014121
57/10/2014120
66/26/2014210
77/8/2014211
97/19/2014221
 

Viewing all articles
Browse latest Browse all 23857

Trending Articles