geometry_column –
The geometry values to generate the collection. Typically this is a column.
Returns
ST_MultiPolygon Returns a multipolygon that contains all of the geometries in a group.
Examples
Example 1 –
The following example returns a single value which combines all geometries of type ST_Polygon from the SpatialShapes table into a single collection of type ST_MultiPolygon. If the Shape column was of type ST_Polygon then the TREAT function and WHERE clause would not be necessary.
SELECT ST_MultiPolygon::ST_MultiPolygonAggr( TREAT( Shape AS ST_Polygon ) )
FROM SpatialShapes WHERE Shape IS OF( ST_Polygon )