这四个(RANK、DENSE_RANK、NTILE、ROW_NUMBER)函数,都是用来对数据库中的数据进行排名的,在他们的功能各有千秋。
下面介绍一下这四个函数的功能和用法:
首先创建一个Student表
CREATETABLEStudent
(
StudentIDint,
ClassIDint,
Markint
);
然后在表中插入数据INSERTINTOStudent VALUES(1,1,90);
INSERTINTOStudent VALUES(2,1,84);
INSERTINTOStudent VALUES(3,1,80);
INSERTINTOStudent VALUES(5,1,90);
INSERT