Коля
Петя
Игорь
Оля
Света
Аня
Коля - Оля
Коля - Света
Коля - Аня
Петя - Оля
Петя - Света
Петя - Аня
Игорь - Оля
Игорь - Света
Игорь - Аня
set @bn:=0;
set @gn:=0;
select boys, girls from
(select @bn := @bn + 1 as num, boys from (SELECT distinct boys FROM `names`) b1) b2
left join
(select @gn := @gn + 1 as num, girls from (SELECT distinct girls FROM `names`) g1) g2
using (num)