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
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