mysql, select and sorting by group key + with first row that has that key in another column
It was fairly brutal to figure out this answer, but i think a left outer join on the same table matching group to unit column worked. I also had to deal with group column being possibly empty or null.

SELECT
a.id,  
a.unit,  
a.`group`, 
a.col2,  
a.col3,  
a.col4,  
a.col5
FROM tablename AS a
LEFT OUTER JOIN tablename AS b
  ON nullif(a.`group`, '') &lt;=&gt; a.unit
ORDER BY COALESCE(b.unit, a.unit);