In the outer select use something like
select d_p_id, project_name, listagg(admin, ',')
from (...)
group by d_p_id, project_name
The listagg()
function, available in DB2 9.7 and later, aggregates by concatenation within a group, using the specified delimiter.