sql 通过group by、sum聚合查询结果的排序

SELECT PeopleID,People,

  sum(Score) as Score,

   'Rank' =dense_rank() over(order by SUM(Score) desc)

FROM [dbo].[IntegralInputDetail]

GROUP BY PeopleID,People
ORDER BY Score desc

posted @ 2020-07-23 11:16  marisen  阅读(2001)  评论(0编辑  收藏  举报