SELECT defName AS Prozess, SUM(lCount) AS Schleifendurchläufe FROM ( SELECT vi.definitionname AS defName, vi."name" AS instName, va."LOOPCOUNT" AS lCount, vi.id AS piId FROM view_instance vi, view_activity va WHERE va."LOOPCOUNT" IS NOT NULL AND va."INSTANCEID" = vi.id GROUP BY vi.id, vi.definitionname, vi."name",va."LOOPCOUNT") GROUP BY defName