SQL Server添加序號列
select ROW_NUMBER() OVER(ORDER BY Convey_Fee desc) as z,
rank() OVER(ORDER BY Convey_Fee desc) as z,
DENSE_RANK() OVER(ORDER BY Convey_Fee desc) as z,
NTILE(4) OVER(ORDER BY Convey_Fee desc) as z,
(select sum(1) from Consign_D where Convey_Fee<=a.Convey_Fee) num,
(select sum(1) from Consign_D where Convey_Fee
結(jié)果:
作者 飛雲(yún)若雪