select
	sp.acronym as spec,
	array_agg(s.acronym) as sub
from
	specificprogrammes sp
	left outer join subdivisions s on (sp.specificprogrammeid = s.hasspecificprogramme)
group by sp.acronym