你的位置:首页 > 数据库

[数据库]添加序号列(SQL Server)


SELECTROW_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 实际缴费金额
 
ScreenHunter_01 Oct. 21 13.27
 
 
学习地址
http://www.cnblogs.com/cailinaaa/archive/2006/10/20/534988.aspx
http://blog.csdn.net/liu_1983/article/details/7269312