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

# ST_Y

> 返回 GEOGRAPHY 或 GEOMETRY 点的 Y 坐标。

返回点的 Y 坐标。

对于 `GEOGRAPHY` 值，在 OGC:CRS84 球面语义下，Y 表示以度为单位的纬度。对于 `GEOMETRY` 值，Y 使用其声明的 CRS 单位，并不一定表示纬度。输入值必须是非空的 `POINT`。

## 语法

### 原生类型重载

```sql theme={null}
DOUBLE ST_Y(GEOGRAPHY point)
DOUBLE ST_Y(GEOMETRY point)
```

### 旧版重载

```sql theme={null}
DOUBLE ST_Y(VARCHAR point)
```

参数是 [ST\_Point](/documents/cn/4.2/sql-reference/sql-functions/spatial-functions/st_point.md) 等构造函数生成的 `VARCHAR` 点编码。

## 返回值说明

输入为 `NULL` 时返回 `NULL`。对于原生 `GEOGRAPHY` 和 `GEOMETRY`，如果输入为空值或不是 `POINT` 类型，则返回错误。原生计算支持具有有效描述符的 XY 值。

## 示例

### 原生类型示例

```sql theme={null}
SELECT ST_Y(ST_GeogFromText('POINT (24.7 56.7)'));
-- 56.7

SELECT ST_Y(ST_GeomFromText('POINT (1000000 2000000.5)', 'EPSG:3857'));
-- 2000000.5
```

### 旧版示例

```sql theme={null}
SELECT ST_Y(ST_Point(24.7, 56.7));
-- 56.7
```

## 相关数据类型

[GEOGRAPHY](/documents/cn/4.2/sql-reference/data-types/spatial-types/GEOGRAPHY.md), [GEOMETRY](/documents/cn/4.2/sql-reference/data-types/spatial-types/GEOMETRY.md), [VARCHAR](/documents/cn/4.2/sql-reference/data-types/string-type/VARCHAR.md), [DOUBLE](/documents/cn/4.2/sql-reference/data-types/numeric/DOUBLE.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.