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

			AND version = 'v0.3.0'
			AND generation_type not in ('biomass','gas','reservoir','run_of_river')
			AND flag in ('commissioning', 'repowering')
			Group BY id
			Order by id)
		 AND scenario in ('NEP 2035')

		 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)
