 		 ORDER BY id	
 	) sub2
         UNION 
-	SELECT
+	SELECT DISTINCT ON (id)
 	sub3.*
 	FROM  ( 
 		SELECT  DISTINCT ON (id)

-- MView for eGo 100
DROP MATERIALIZED VIEW IF EXISTS supply.ego_dp_res_powerplant_ego100_mview CASCADE;
CREATE MATERIALIZED VIEW supply.ego_dp_res_powerplant_ego100_mview AS
	SELECT
	sub.*
	FROM  ( 
		SELECT DISTINCT ON (id)

		 AND version = 'v0.3.0'
		 AND electrical_capacity > 0
		 AND generation_type in ('solar','wind')
		 AND generation_subtype not in ('wind_offshore')
		 ORDER BY id	
		 ) as sub
	UNION 
	SELECT DISTINCT ON (id)
	sub2.*
	FROM  ( 
		SELECT  DISTINCT ON (id)
