📜  sql代码示例中的排名函数

📅  最后修改于: 2022-03-11 15:05:05.802000             🧑  作者: Mango

代码示例2
ROW_NUMBER() -- 1,2,3,4,5 (different rank no. to same value)
RANK() --  1,2,2,4,5 (same rank no. to same value but next rank is skipped)
DENSE_RANK() --  1,2,2,3,4 (same rank no. to same value but no skip in rank no.)

RANKING FUNCTION NAME() OVER([PARTITION BY ] ORDER BY
 [ASC / DESC])
-- PARTITION BY ------> OPTIONAL (ON GROUP OF ROWS).
-- ORDER BY -------> MANADATORY CLAUSE.