Let us say i have list of students and score against each student. (Name of student may\may not repeat. i the list of top 3 students(Rank) and sum of scores against each student.
Input:
[TABLE="width: 596"]
<tbody>[TR]
[TD][/TD]
[TD="align: center"]A[/TD]
[TD="align: center"]B[/TD]
[/TR]
[TR]
[TD="align: center"]1[/TD]
[TD="align: center"]Shash[/TD]
[TD="align: center"]40[/TD]
[/TR]
[TR]
[TD="align: center"]2[/TD]
[TD="align: center"]Yog[/TD]
[TD="align: center"]10[/TD]
[/TR]
[TR]
[TD="align: center"]3[/TD]
[TD="align: center"]Yog[/TD]
[TD="align: center"]10[/TD]
[/TR]
[TR]
[TD="align: center"]4[/TD]
[TD="align: center"]Avi[/TD]
[TD="align: center"]10[/TD]
[/TR]
[TR]
[TD="align: center"]5[/TD]
[TD="align: center"]Ran[/TD]
[TD="align: center"]80[/TD]
[/TR]
[TR]
[TD="align: center"]6[/TD]
[TD="align: center"]Shash[/TD]
[TD="align: center"]50[/TD]
[/TR]
[TR]
[TD="align: center"]7[/TD]
[TD="align: center"]Raj[/TD]
[TD="align: center"]5[/TD]
[/TR]
[TR]
[TD="align: center"]8[/TD]
[TD="align: center"]Raj[/TD]
[TD="align: center"]2[/TD]
[/TR]
</tbody>[/TABLE]
Output:
Result must be
[TABLE="width: 557"]
<tbody>[TR]
[TD][/TD]
[TD]Name[/TD]
[TD]Top 3 total scores[/TD]
[/TR]
[TR]
[TD]Rank 1[/TD]
[TD]Shash[/TD]
[TD]90[/TD]
[/TR]
[TR]
[TD]Rank 2[/TD]
[TD]Ran[/TD]
[TD]80[/TD]
[/TR]
[TR]
[TD]Rank 3[/TD]
[TD]Yog[/TD]
[TD]20[/TD]
[/TR]
</tbody>[/TABLE]
Input:
[TABLE="width: 596"]
<tbody>[TR]
[TD][/TD]
[TD="align: center"]A[/TD]
[TD="align: center"]B[/TD]
[/TR]
[TR]
[TD="align: center"]1[/TD]
[TD="align: center"]Shash[/TD]
[TD="align: center"]40[/TD]
[/TR]
[TR]
[TD="align: center"]2[/TD]
[TD="align: center"]Yog[/TD]
[TD="align: center"]10[/TD]
[/TR]
[TR]
[TD="align: center"]3[/TD]
[TD="align: center"]Yog[/TD]
[TD="align: center"]10[/TD]
[/TR]
[TR]
[TD="align: center"]4[/TD]
[TD="align: center"]Avi[/TD]
[TD="align: center"]10[/TD]
[/TR]
[TR]
[TD="align: center"]5[/TD]
[TD="align: center"]Ran[/TD]
[TD="align: center"]80[/TD]
[/TR]
[TR]
[TD="align: center"]6[/TD]
[TD="align: center"]Shash[/TD]
[TD="align: center"]50[/TD]
[/TR]
[TR]
[TD="align: center"]7[/TD]
[TD="align: center"]Raj[/TD]
[TD="align: center"]5[/TD]
[/TR]
[TR]
[TD="align: center"]8[/TD]
[TD="align: center"]Raj[/TD]
[TD="align: center"]2[/TD]
[/TR]
</tbody>[/TABLE]
Output:
Result must be
[TABLE="width: 557"]
<tbody>[TR]
[TD][/TD]
[TD]Name[/TD]
[TD]Top 3 total scores[/TD]
[/TR]
[TR]
[TD]Rank 1[/TD]
[TD]Shash[/TD]
[TD]90[/TD]
[/TR]
[TR]
[TD]Rank 2[/TD]
[TD]Ran[/TD]
[TD]80[/TD]
[/TR]
[TR]
[TD]Rank 3[/TD]
[TD]Yog[/TD]
[TD]20[/TD]
[/TR]
</tbody>[/TABLE]