ST_Union

Introduction: Return the union of geometry A and B

ST_Union

Format: ST_Union (A:geometry, B:geometry)

Return type: Geometry

Example:

SELECT ST_Union(ST_GeomFromWKT('POLYGON ((-3 -3, 3 -3, 3 3, -3 3, -3 -3))'), ST_GeomFromWKT('POLYGON ((1 -2, 5 0, 1 2, 1 -2))'))

Result:

POLYGON ((3 -1, 3 -3, -3 -3, -3 3, 3 3, 3 1, 5 0, 3 -1))