日期:2014-05-16  浏览次数:20803 次

求一个SQL
一个表 有3个column  
class_no(班级)
student_no(学号)
score(成绩)

统计出来结果:

class_no(班级)
student_no(学号)
score_level 成绩排名

怎么写?

------解决方案--------------------
SQL code
select class,student_no,(select count(*)+1 from 一个表 where class=a.class and scorre>a.scorre) as score_level
from 一个表 a
order by 1,3