📣
TiDB Cloud Premium is now in public preview. Unlimited growth, instant elasticity, advanced security for enterprise workloads. Try it out →

ST_X



Returns the longitude (X coordinate) of a Point represented by a GEOMETRY or GEOGRAPHY object.

Syntax

ST_X(<geometry_or_geography>)

Arguments

ArgumentsDescription
<geometry_or_geography>The argument must be an expression of type GEOMETRY or GEOGRAPHY and must contain a Point.

Return Type

Double.

Examples

GEOMETRY examples

SELECT ST_X( ST_MAKEGEOMPOINT( 37.5, 45.5 ) ) AS pipeline_x; ┌────────────┐ │ pipeline_x │ ├────────────┤ │ 37.5 │ └────────────┘

GEOGRAPHY examples

SELECT ST_X( ST_GEOGFROMWKT( 'POINT(37.5 45.5)' ) ) AS pipeline_x; ┌────────────┐ │ pipeline_x │ ├────────────┤ │ 37.5 │ └────────────┘

Was this page helpful?