📣
TiDB Cloud Premium is now in public preview. Unlimited growth, instant elasticity, advanced security for enterprise workloads. Try it out →

ST_UNION



Returns the combined GEOMETRY made from two input GEOMETRY objects.

This function only supports GEOMETRY values.

Syntax

ST_UNION(<geometry1>, <geometry2>)

Arguments

ArgumentsDescription
<geometry1>The argument must be an expression of type GEOMETRY.
<geometry2>The argument must be an expression of type GEOMETRY.

Return Type

GEOMETRY.

Examples

SELECT ST_ASWKT(ST_UNION(TO_GEOMETRY('POINT(0 0)'), TO_GEOMETRY('POINT(1 1)'))); ╭──────────────────────────────────────────────────────────────────────────╮ │ st_aswkt(st_union(to_geometry('POINT(0 0)'), to_geometry('POINT(1 1)'))) │ ├──────────────────────────────────────────────────────────────────────────┤ │ MULTIPOINT(0 0,1 1) │ ╰──────────────────────────────────────────────────────────────────────────╯

Was this page helpful?