ST_INTERSECTION
Returns the shared part of two GEOMETRY objects.
This function only supports GEOMETRY values.
Syntax
ST_INTERSECTION(<geometry1>, <geometry2>)
Arguments
Return Type
GEOMETRY.
Examples
SELECT ST_ASWKT(ST_INTERSECTION(TO_GEOMETRY('LINESTRING(0 0, 1 1)'), TO_GEOMETRY('LINESTRING(0 0, 1 1)')));
╭─────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ st_aswkt(st_intersection(to_geometry('LINESTRING(0 0, 1 1)'), to_geometry('LINESTRING(0 0, 1 1)'))) │
├─────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ LINESTRING(0 0,1 1) │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────╯