id one two thr fou five
1 37 84 1 68 10
2 72 50 87 41 67
3 66 30 89 57 48
4 29 27 35 75 36
5 2 72 9 1 55
6 33 89 17 40 64
7 70 90 63 26 54
8 36 19 51 43 61
9 10 61 20 44 84
10 2 41 43 65 87
I need to reverse count each number in the above table.
Examples:
61=>1 because if you count from the bottom to the first 61 there's 1 row
26=>3 because if you count from the bottom to the first 26 there are 3 rows
9=>5 because if you count from the bottom to the first 9 there are 5 rows
and so on...
The query should output a table similar to the following for all numbers:
Number Rows count
61 1
26 3
9 5
The problem here is: How to reverse count in mySQL? Is there a special function? Thank you