The biggest problem you face is that you want 2 quite different aspects. You want it in the order of the username, but if there is a matching parent, you want to group it.
The most obvious will be
select username, parent from mytable order by parent,username group by parent
But that still sorts it by parent.
I’m sure that you can get it exactly what you wanted, but I didn’t have coffee yet to work out an easy complete solution.
source share