18、按各科成绩进行排序,并显示排名, Score 重复时保留名次空缺
①、
select sid,cid,score,
rank() over (partition by cid order by score) AS ranking
from SC;
sid | cid | score | ranking
------------+------------+-------+---------
06 | 01 | 31 | 1
04 | 01 | 50 | 2
0