ST_Y()

TL;DR

Use ST_Y() to obtain the second coordinate of a point.

Returns a point’s Y coordinate.

Syntax

ST_Y(point)

Arguments

Argument

Description

point

A POINT GEOMETRY or GEOMETRY32 value.

Return Value

Returns FLOAT64 for GEOMETRY and FLOAT32 for GEOMETRY32.

Usage Notes

  • The GEOMETRY32 overload returns a float32 value, as verified by geo_geometry32.sql.

Examples

DROP DATABASE IF EXISTS geo_y_demo;
CREATE DATABASE geo_y_demo;
USE geo_y_demo;

SELECT ST_Y(ST_GeomFromText('POINT(3 4)')) AS y_coordinate;

DROP DATABASE geo_y_demo;

See Also