Hey, no problem! Try this (change the column names a bit, but that's easy - d1=x, d2=y, emp=z)
with x (d1, d2, cnt, list, emp, len)
as (
select d1, d2, count(*) over (partition by d1, d2),
cast(char(emp) as varchar(100)), emp, 1
from test
union all
select x.d1, x.d2, x.cnt, x.list ||','|| char(e.emp), e.emp, x.len+1
from test e, x
where e.d1 = x.d1 and e.d2 = x.d2
and e.emp > x.emp
)
select d1, d2, list
from x
where len = cnt
order by d1, d2
;
cheers,
Rob.