标签:mys HERE mysq select 判断 name esc count desc
SELECT * FROM course a WHERE
3>(SELECT COUNT(*) FROM course WHERE coursename=a.coursename and score>a.score)
ORDER BY a.coursename,a.score DESC;
取每一条记录,判断同一个班级,大于当前成绩的同学是不是小于2个人。
标签:mys HERE mysq select 判断 name esc count desc
原文地址:https://www.cnblogs.com/fenghua/p/9109160.html