下图是"班级"表中的内容,记录了每个学生所在班级和对应的成绩。
1 select *, 2 rank() over (order by 成绩 desc) as ranking, 3 dense_rank() over (order by 成绩 desc) as dese_rank, 4 row_number() over (order by 成绩 desc) as row_num 5 from 班级
得到结果: