> For the complete documentation index, see [llms.txt](https://mariadb.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mariadb.com/docs/server/reference/sql-statements/geometry-constructors/geometry-properties/st_geometryn.md).

# ST\_GEOMETRYN

## Syntax

```bnf
ST_GeometryN(gc,N)
GeometryN(gc,N)
```

## Description

Returns the N-th geometry in the GeometryCollection *`gc`.* Geometries are numbered beginning with 1.

`ST_GeometryN()` and `GeometryN()` are synonyms.

## Example

```sql
SET @gc = 'GeometryCollection(Point(1 1),LineString(12 14, 9 11))';

SELECT AsText(GeometryN(GeomFromText(@gc),1));
+----------------------------------------+
| AsText(GeometryN(GeomFromText(@gc),1)) |
+----------------------------------------+
| POINT(1 1)                             |
+----------------------------------------+
```

<sub>*This page is licensed: CC BY-SA / Gnu FDL*</sub>

{% @marketo/form formId="4316" %}
