 FROM
 ( 
 	SELECT 
-	sum(sector_area_retail), 
+	sum(coalesce(sector_area_retail,0)), 
 	substr(nuts,1,5) 
 	FROM calc_ego_loads.ego_deu_load_area
 	GROUP BY substr(nuts,1,5)

) AS sub
WHERE
sub.id = a.id;


---------- ---------- ----------

FROM
( 
	SELECT 
	sum(coalesce(sector_area_agricultural,0)), 
	substr(nuts,1,5) 
	FROM calc_ego_loads.ego_deu_load_area
	GROUP BY substr(nuts,1,5)
