GROUP BY is kind of a misnomer. It'll group your results, but not in a fashion that is useful outside of finding sums or average. What you're looking for is a complex ORDER BY I think.
Try changing your order clause to
Code:
ORDER BY `groupname`,`name`
This will sort by groupname, then by name within that.
Maybe I didn't get what you're trying to do, but I tried to do a lot of stuff like this before and you really can't with a single group by query.