select distinct jahr, mm,
(select string_agg(sprache, ',')
from (
select distinct sprache
from the_table t2
where t2.jahr = t1.jahr
and t2.mm = t1.mm) s1) as sprachen,
(select string_agg(tools, ',')
from (
select distinct tools
from the_table t2
where t2.jahr = t1.jahr
and t2.mm = t1.mm) s1) as tools
from the_table t1