with t as (select 'Группа1' group_name from dual
union all
select 'Группа2' group_name from dual
union all
select 'Группа2' group_name from dual
union all
select 'Группа3' group_name from dual
union all
select 'Группа3' group_name from dual
union all
select 'Группа3' group_name from dual
union all
select 'Группа3' group_name from dual
union all
select 'Группа4' group_name from dual
union all
select 'Группа4' group_name from dual
union all
select 'Группа4' group_name from dual
union all
select 'Группа4' group_name from dual
union all
select 'Группа4' group_name from dual
union all
select 'Группа4' group_name from dual)
select rnum, group_name
from (select group_name,
count(*) over(partition by group_name) cnt,
row_number() over(partition by group_name order by group_name) rnum
from t) tt
where mod(rnum, 2) <> 0
|