SELECT ROW_NUMBER() OVER (ORDER BY 实际缴费金额 ) AS A, --序号 rank() OVER (ORDER BY 实际缴费金额 ) AS B, --相同的算一个,跳过从新计算 DENSE_RANK() OVER (ORDER BY 实际缴费金额 ) AS C, --相同的算一个,不跳过从新计算 NTILE(4) OVER(ORDER BY 实际缴费金额 desc) AS D, --按给出的数字分组 实际缴费金额 FROM [dbo].[A流向费汇总] ORDER BY 实际缴费金额
学习地址:
http://www.cnblogs.com/cailinaaa/archive/2006/10/20/534988.aspx
http://blog.csdn.net/liu_1983/article/details/7269312
时间: 2024-11-05 12:16:29