1 ----------- ERROR : ------------
ERROR: SELECT DISTINCT uneplive_replica_gegs.time_id.year_start FROM uneplive_replica_gegs.data JOIN uneplive_replica_gegs.time_id ON uneplive_replica_gegs.data."time_ID" = uneplive_replica_gegs.time_id.time_id WHERE uneplive_replica_gegs.data."Indicator_ID" = mpx_3 ORDER BY uneplive_replica_gegs.time_id.year_start


1 ----------- ERROR : ------------
ERROR: SELECT DISTINCT uneplive_replica_gegs.time_id.year_start FROM uneplive_replica_gegs.data JOIN uneplive_replica_gegs.time_id ON uneplive_replica_gegs.data."time_ID" = uneplive_replica_gegs.time_id.time_id WHERE uneplive_replica_gegs.data."Indicator_ID" = mpx_3 ORDER BY uneplive_replica_gegs.time_id.year_start


1 ----------- ERROR : ------------
ERROR: SELECT * FROM ( SELECT uneplive_replica_gegs.country.country_id, uneplive_replica_gegs.country.country_name, uneplive_replica_gegs.country.un_region, '0' AS "region" FROM uneplive_replica_gegs.country WHERE country_id = 1 ORDER BY uneplive_replica_gegs.country.country_name ASC ) c LEFT JOIN ( SELECT uneplive_replica_gegs.agg_data.country_id, uneplive_replica_gegs.agg_data.data_value, uneplive_replica_gegs.time_id.year_start FROM uneplive_replica_gegs.agg_data JOIN uneplive_replica_gegs.time_id ON uneplive_replica_gegs.agg_data."time_ID" = uneplive_replica_gegs.time_id.time_id WHERE uneplive_replica_gegs.agg_data."Indicator_ID" = mpx_3 ) d ON c.country_id = d.country_id UNION ALL SELECT * FROM ( SELECT uneplive_replica_gegs.country.country_id, uneplive_replica_gegs.country.country_name, uneplive_replica_gegs.country.un_region, '1' AS "region" FROM uneplive_replica_gegs.country WHERE country_id = 2 OR country_id = 150 OR country_id = 920 OR country_id = 21 OR country_id = 145 OR country_id = 1741900 ORDER BY uneplive_replica_gegs.country.country_name ASC ) c LEFT JOIN ( SELECT uneplive_replica_gegs.agg_data.country_id, uneplive_replica_gegs.agg_data.data_value, uneplive_replica_gegs.time_id.year_start FROM uneplive_replica_gegs.agg_data JOIN uneplive_replica_gegs.time_id ON uneplive_replica_gegs.agg_data."time_ID" = uneplive_replica_gegs.time_id.time_id WHERE uneplive_replica_gegs.agg_data."Indicator_ID" = mpx_3 ) d ON c.country_id = d.country_id UNION ALL SELECT * FROM ( SELECT uneplive_replica_gegs.country.country_id, uneplive_replica_gegs.country.country_name, uneplive_replica_gegs.country.un_region, '2' AS "region" FROM uneplive_replica_gegs.country WHERE country_id = 53 OR country_id = 29 OR country_id = 13 OR country_id = 143 OR country_id = 62 OR country_id = 14 OR country_id = 30 OR country_id = 753 OR country_id = 151 OR country_id = 54 OR country_id = 57 OR country_id = 17 OR country_id = 21 OR country_id = 15 OR country_id = 154 OR country_id = 9 OR country_id = 543 OR country_id = 61 OR country_id = 5 OR country_id = 35 OR country_id = 18 OR country_id = 34 OR country_id = 39 OR country_id = 11 OR country_id = 145 OR country_id = 747 OR country_id = 155 ORDER BY uneplive_replica_gegs.country.country_name ASC ) c LEFT JOIN ( SELECT uneplive_replica_gegs.agg_data.country_id, uneplive_replica_gegs.agg_data.data_value, uneplive_replica_gegs.time_id.year_start FROM uneplive_replica_gegs.agg_data JOIN uneplive_replica_gegs.time_id ON uneplive_replica_gegs.agg_data."time_ID" = uneplive_replica_gegs.time_id.time_id WHERE uneplive_replica_gegs.agg_data."Indicator_ID" = mpx_3 ) d ON c.country_id = d.country_id UNION ALL SELECT * FROM ( SELECT uneplive_replica_gegs.country.country_id, uneplive_replica_gegs.country.country_name, uneplive_replica_gegs.country.un_region, '3' AS "region" FROM uneplive_replica_gegs.country WHERE country_id = 800000 OR country_id = 800001 OR country_id = 199 OR country_id = 722 OR country_id = 1720200 OR country_id = 500000 ORDER BY uneplive_replica_gegs.country.country_name ASC ) c LEFT JOIN ( SELECT uneplive_replica_gegs.agg_data.country_id, uneplive_replica_gegs.agg_data.data_value, uneplive_replica_gegs.time_id.year_start FROM uneplive_replica_gegs.agg_data JOIN uneplive_replica_gegs.time_id ON uneplive_replica_gegs.agg_data."time_ID" = uneplive_replica_gegs.time_id.time_id WHERE uneplive_replica_gegs.agg_data."Indicator_ID" = mpx_3 ) d ON c.country_id = d.country_id UNION ALL SELECT * FROM ( SELECT uneplive_replica_gegs.country.country_id, uneplive_replica_gegs.country.country_name, uneplive_replica_gegs.country.un_region, '4' AS "region" FROM uneplive_replica_gegs.country WHERE un_member = 1 ORDER BY uneplive_replica_gegs.country.country_name ASC ) c LEFT JOIN ( SELECT uneplive_replica_gegs."data".country_id, uneplive_replica_gegs."data".data_value, uneplive_replica_gegs.time_id.year_start FROM uneplive_replica_gegs."data" JOIN uneplive_replica_gegs.time_id ON uneplive_replica_gegs.data."time_ID" = uneplive_replica_gegs.time_id.time_id WHERE uneplive_replica_gegs."data"."Indicator_ID" = mpx_3 ) d ON c.country_id = d.country_id ORDER BY region ASC, un_region ASC, country_name ASC, year_start ASC