I have a table with data like this
ID | second_col
1 | 1
1 | 2
1 | 3
2 | 1
2 | 4
3 | 1
3 | 5
4 | 1
and i want select records from duplicated rows with the biggest number in second_col
the result should look as follows…
ID | second_col
1 | 3
2 | 4
3 | 5
4 | 1
Assuming SQL Server is being used, you could do the following: