select group, (select member where order = 1) union all select group, (select member where order = 2) union all ...