下表列出了多项考试中的学生成绩数据。
+---------+--------+-------------+-------------+-------------+--------------+
| name | exams | grade_poor | grade_fair | grade_good | grade_vgood |
+---------+--------+-------------+-------------+-------------+--------------+
| arun | 8 | 1 | 4 | 2 | 1 |
| neha | 10 | 3 | 2 | 1 | 4 |
| ram | 5 | 1 | 1 | 3 | 0 |
| radha | 8 | 0 | 3 | 1 | 4 |
+---------+--------+-------------+-------------+-------------+--------------+
等级已订购并具有以下数值
+-------------+--------+
| grade | value |
+-------------+--------+
| grade_poor | 0 |
| grade_fair | 1 |
| grade_good | 2 |
| grade_vgood | 3 |
+-------------+--------+
需要在价值方面找到每个学生的第50个百分位等级,如下表所示。
+-------+--------+------------------+
| grade | exams | grade_perc50th |
+-------+--------+------------------+
| arun | 8 | 1 |
| neha | 10 | 1.5 |
| ram | 5 | 2 |
| radha | 8 | 2.5 |
+-------+--------+------------------+
此问题与this one有关,但不同 - 不是标记的完全重复。