My data looks like this:
StuId StuName Exam Attempt Score
1 Sam Eng 1 45
1 Sam Eng 2 58
1 Sam Eng 3 63
2 Mat Eng 1 65
2 Mat Eng 2 75
The student has passed if he has gotten above 60. I would want to fetch first successful attempt for each student and ignore all other attempts My expected result set looks like this:
StuId StuName Exam Attempt Score
1 Sam Eng 3 63
2 Mat Eng 1 65
Is there a way I can achieve this in SQL Server?