I have a table that can contain up to 12 entries for an individual in the number field each number can be different number I want only to add up the top 7 numbers for each individual. What's the easiest way to do this.
Select IndividualId, Value
From YourTable
Where Id In
(Select Top 7 T.Id
From YourTable As T
Where T.IndividualId = YourTable.IndividualId
Order by T.Value Desc, T.Id)
Comment