When you group data together, you can only return the group clause and aggregate information such as a count or sum.
Think about it:
Name PenColour NoPens
Joe Blue 2
Joe Green 3
Mike Blue 1
Mike Red 4
When you GROUP these by name you get combined records:
Name PenColour NoPens
Joe Blue and Green 2 and 3
Mike Blue and Red 1 and 4
Clearly, you can't return a PenColour for Joe because there are two distinct values and only one row to return them in - And SQL deosn't know which one it should return. So you can return an aggregate of the other info in a group, but you can't return multiple values.
If you want to find the user with the maximum salary within each group, you need to use a more complex subquery.
See here - it explains it well:
http://www.xaprb.com/blog/2006/12/07/how-to-select-the-firstleastmax-row-per-group-in-sql/[
^]