Skip to main content

ST_Y

Returns the Y coordinate of a Point geometry.

Syntax

ST_Y(geometry)

Parameters

ParameterTypeDescription
geometryGeometryPoint geometry

Returns

TypeDescription
Float64Y coordinate value

Examples

Get Y Coordinate

SELECT ST_Y(ST_Point(10.5, 20.3));
-- Returns: 20.3

Extract Coordinates from Points

SELECT id, ST_X(geom) as longitude, ST_Y(geom) as latitude
FROM locations;

Filter by Y Range

SELECT * FROM points
WHERE ST_Y(geom) BETWEEN 37.0 AND 38.0;

Calculate Distance from Equator

SELECT id, ABS(ST_Y(geom)) as distance_from_equator
FROM cities;

Notes

  • Only valid for Point geometries
  • For geographic data, Y typically represents latitude
  • Returns NULL if geometry is not a Point
  • Works with both GeoArrow Point and WKB Point formats

See Also