Sql order by within a group by with aggregate
- by NG
Say I have
Team/Name/Some number
Cardinals Jason 8
Cardinals Chris 5
Yankees Joba 6
Cubs Carlos 6
Cardinals Chris 6
And I want
Cardinals Jason 8
Cardinals Chris 11
Cubs Carlos 6
Yankees Joba 6
So, what I'm doing is grouping by team, grouping by name, summing by some number
However, within cardinals I want to make sure the names are in a particular order. If I just do an "order by name desc" for example then the the whole grouping gets ignored. So how can I order within a group.