SELECT a.roleid, string_agg(b.orgname, ',') orgname FROM t_con_role_org a, t_e_org_edu b WHERE a.orgeduid = b.orgid GROUP BY a.roleid