group fees 1 200 1 300 2 200 2 400 2 600 3 500
300+600+500=1400
select group,sum(Fees) as TotalFees from ( Select group,max(fees) as Fees from Table group by group )A
SELECT SUM([fees]) AS MaxOfFees FROM ( SELECT [group], MAX([fees]) AS [fees] FROM YourTable GROUP BY [group])
SELECT SUM(maximum) FROM (SELECT MAX(fees) as maximum FROM myTable GROUP BY [group]) a
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)