灵活SQL语句

一、查询数学成绩排名 select stid, name, score, (select count(*) from stuscore s where s.subject='数学' and s.score > score)+1  from stuscore where subject='数学' order by score 灵活点:用一个子查询查询出比当前人成绩大的有多少人,那么有多少人就是第几名
相关文章
相关标签/搜索