In a PostGRES/PostGIS database, I have a table "myTable" containing very large numbers of polygons (the geometry is under the column "Polygon"). Each polygon has a numerical value under the "Var1" column. They also each fall under an area stored as a string in the "Region" column.
Since these polygons are too numerous, I'd like to aggregate them according to the region they belong to.
This is what I'm doing:
SELECT ST_Collect(Polygon) as geom FROM myTable GROUP BY Region;
Although, by doing that, I lose the very important values under Var1.
How can I compute the means of the values of Var1 for each polygons under the same Region, and output it in my query?