ST_X
Returns the longitude (X coordinate) of a Point represented by a GEOMETRY or GEOGRAPHY object.
Syntax
ST_X(<geometry_or_geography>)
Arguments
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 │
└────────────┘