SQL几类排名函数的使用介绍
--查询出各类排名 SELECT orderid,qty, ROW_NUMBER() OVER(ORDER BY qty) AS rownumber,--序号 RANK() OVER(ORDER BY qty) AS [rank],--断开的排名 DENSE_RANK() OVER(ORDER BY qty) AS denserank ,--连续的排名 NTILE(4) OVER(ORDER BY qty) AS [NTILE]--均分成四个数组 FROM rankorder ORDER BY qty