Jump to content

i want to sort the data i.e., fetched from the database based on total points


Shekar Kumar

Recommended Posts

Hai everyOne,

 

          I am facing the problem in getting my array of elements getting sorted acccording to the total points .

->ppose the conducted exams are  '4' ----  exam1,exam2,exam3,exam4

-> in each exam he assures some points.say from 1 to 10.

->total points = sum of the points(exam1,exam2,exam3,exam4)

Sorting must be done based on three conditions:

 

1. First the entire array lists must be sorted according to the total points

2. second if two rows have the same total points then it has to sort based on the highest individual points he secured in exams  i.e.,  if totals for two studentsis say 20

          for one student1 it is the sum of  5,5,4,6 --->  maxvalue is '6'

          and for the student2 it is    the sum of  7,3,5,5  ----> maxvalue is '7'

        then i want to get the student2  on top of student1  in arranging the list in descorder i.e,a/c to highest points  because student2 has get the maxvalue--7- which is greater than any rank of student1.

 

 

this is how i want my records to be sorted.

 

thanks in advance

 

bai

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.