How to order the rows with respect to multiple columns such that the ordering maintains the condition that if two people have the same details they get the same rank. I will give an example to illustrate :Here firstly ordering is done by score and in case of tie with penalty and still if tie exist both are given same rank and next person gets the adjusted rank.
###################
rank roll score penalty
1 11 3 23
2 12 3 20
2 13 3 20
2 14 3 20
5 15 2 10
So the question is how to fill the rank column??If not possible in mysql what is the other alternative??
Test data:
And here it comes:
You need to work with a temporary table here, because you can’t update the table you are reading from. The temporary table will be automatically deleted when the session ends.