5. Geospatial Functions : GeometryN
 
Share this page                  
GeometryN
GEOMETRYN(g Geometrycollection, n interger)
Alias: ST_GEOMETRYN
Returns the nth object from g.
Result type: geometry
Example:
SELECT ASTEXT(GEOMETRYN(MLINEFROMTEXT('MULTILINESTRING((1 1, 9 1), (2 2, 8 2))'), 2));
--------------------------------
col1
--------------------------------
LINESTRING (2 2, 8 2)
--------------------------------