> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wherobots.com/llms.txt
> Use this file to discover all available pages before exploring further.

# ST_GeometryN

Return the 0-based Nth geometry if the geometry is a GEOMETRYCOLLECTION, (MULTI)POINT, (MULTI)LINESTRING, MULTICURVE or (MULTI)POLYGON. Otherwise, return null

<img src="https://mintcdn.com/wherobots/fqh3gPDE0J25Lra_/images/sql-functions/ST_GeometryN/ST_GeometryN.svg?fit=max&auto=format&n=fqh3gPDE0J25Lra_&q=85&s=f55f6a18766b56817572de1d4a7c498e" alt="ST_GeometryN" width="500" height="300" data-path="images/sql-functions/ST_GeometryN/ST_GeometryN.svg" />

## Signatures

```sql theme={"system"}
ST_GeometryN(geom: Geometry, n: Integer)
```

## Parameters

<ParamField body="geom" type="Geometry" required>
  The input geometry.
</ParamField>

<ParamField body="n" type="Integer" required>
  The index or count value.
</ParamField>

## Return type

<ResponseField type="Geometry">
  The resulting geometry.
</ResponseField>

## Example

```sql theme={"system"}
SELECT ST_GeometryN(ST_GeomFromText('MULTIPOINT((1 2), (3 4), (5 6), (8 9))'), 1)
```

```
POINT (3 4)
```
