I have a scenario as below
Input File -
Student-ID Payment-Id Payment
1 2 100
1 1 300
1 3 100
2 1 500
2 2 300
Output File -
Student-ID Payment-Id Payment
1 3 100
2 2 300
Student-ID Payment-Id Payment
1 2 100
1 1 300
1 3 100
2 1 500
2 2 300
Output File -
Student-ID Payment-Id Payment
1 3 100
2 2 300
I want to retrieve a single record for each student having highest payment id
Please help me accomplish this .