SELECT
count( CASE WHEN score BETWEEN 91 AND 100 THEN 1 END) AS A,
count( CASE WHEN score BETWEEN 81 AND 90 THEN 1 END ) AS B,
count( CASE WHEN score BETWEEN 61 AND 80 THEN 1 END ) AS C,
count( CASE WHEN score < 60 THEN 1 END ) AS D,
c.classname
FROM
exam_student e
LEFT JOIN student s ON e.studentcode = s.studentcode
LEFT JOIN class c ON s.classid = c.id
GROUP BY c.classname
分段求成绩 按照班级排名 作下记录
最新推荐文章于 2024-04-05 00:14:28 发布