I need to write a query in SQL Server that gets the max value of a certain column for each group along with the corresponding value of another column.
This is a simplification of my case:
group | value | other_value
-------+-------+------------
First | 5 | 2
First | 12 | 4
First | 7 | 7
Second | 12 | 43
Second | 45 | 12
Third | 45 | 7
Result of query :
group | max_value | other_value
-------+-----------+------------
First | 12 | 4
Second | 45 | 12
Third | 45 | 7