i solve it with sql....
select onoma,odos,thl,
max(case when c=1 then col end) thl1,
max(case when c=2 then col end) thl2,
max(case when c=3 then col end) thl3,
max(case when c=4 then col end) thl4,
max(case when c=5 then col end) thl5,
max(case when c=6 then col end) thl6,
max(case when c=7 then col end) thl7,
max(case when c=8 then col end) thl8
from (select a.onoma, a.odos,a.thl, a.col, count(*) as c
from forthnetnew as a join forthnetnew as b on a.onoma=b.onoma and a.col <= b.col and a.odos=b.odos
group by a.onoma, a.odos,a.thl, a.col) x
group by onoma, odos,thl
order by onoma