首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > Mysql >

SQL

2012-03-14 
求一个SQL一个表 有3个columnclass_no(班级)student_no(学号)score(成绩)统计出来结果:class_no(班级)stud

求一个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_levelfrom 一个表 aorder by 1,3 

热点排行