查询学生学科排名

来源:互联网 发布:大学生程序员兼职平台 编辑:程序博客网 时间:2024/04/29 04:42

表结构如下:
成绩表

要求结果:
这里写图片描述
sql语句:

SELECT a.*, count(*) as rank FROM chengji aJOIN chengji b ON a.xueke = b.xueke AND a.score <= b.scoreGROUP BY a.xueke,a.nameORDER BY a.xueke asc,a.score desc
0 0
原创粉丝点击