—rank()over(order by 列名 排序)的结果是不连续的,如果有4个人,其中有3个是并列第1名,那么最后的排序结果结果如:1 1 1 4
select scoreid, studentid,COURSENAME,totalexamscore ,
rank()over(order by TOTALEXAMSCORE desc)orderbyNum
from CJ_SCORECOURSE a ,CJ_COURSESCORE b
where a.SCORECOURSEID = b.SCORECOURSEID
—dense_rank()over(order by 列名 排序)的结果是连续的,如果有4个人,其中有3个是并列第1名, 那么最后的排序结果如:1 1 1 2
select scoreid, studentid,COURSENAME,totalexamscore ,
dense_rank()over(order by TOTALEXAMSCORE desc)orderbyNum
from CJ_SCORECOURSE a ,CJ_COURSESCORE b
where a.SCORECOURSEID = b.SCORECOURSEID