滨海机场停车过夜:SQL 问题。

来源:百度文库 编辑:中科新闻网 时间:2024/04/28 07:01:17
有一张成绩表(course),只有两个字段,姓名(name)和成绩(score)。怎样用
一个SQL语句查询出某个学生的姓名,成绩以及在成绩表中的排名?
表结构如下:
表名:Course
姓名字段:name
成绩字段:score

select *,(select count(1) from (select distinct fs from Course
) t where t.fs>=a.fs) as paiming
from Course
a
order by score desc,name;