Was this helpful?
Contains
CONTAINS(g1 Geometry, g2 Geometry)
Alias: ST_CONTAINS
Returns 1 when g2 is inside g1; returns 0 otherwise.
Result type: integer
Examples:
SELECT CONTAINS(POLYFROMTEXT('POLYGON((0 0,0 10,5 5,10 10,10 0,0 0))'), POLYFROMTEXT('POLYGON((2 2,2 8,3 3,8 8,8 2,2 2))'));
-------------
col1
-------------
1
-------------
SELECT CONTAINS(POLYFROMTEXT('POLYGON((0 0,0 10,5 5,10 10,10 0,0 0))'), POLYFROMTEXT('POLYGON((2 2,2 8,7 7,8 8,8 2,2 2))'));
---------------
col1
---------------
0
---------------
Last modified date: 04/03/2024