ST_Y

更新时间:
复制 MD 格式

Returns the y coordinate of a point geometry as a float.

Syntax

float ST_Y(geometry aPoint)

Parameters

ParameterDescription
aPointThe point geometry to query.

Usage notes

  • aPoint must be a point geometry.

  • Returns NULL if the input is unavailable or invalid.

  • Supports 3D geometries and preserves z coordinates.

Examples

Return the y coordinate of a 2D point:

SELECT ST_Y('POINT(0 1)'::geometry);

Output:

 st_y
------
    1
(1 row)

Return the y coordinate of a 3D point (z coordinate is preserved, not returned):

SELECT ST_Y('POINT(0 1 2 3)'::geometry);

Output:

 st_y
------
    1
(1 row)