Returns the longitude (X coordinate) of a Point represented by a GEOGRAPHY or GEOMETRY object.
Syntax¶ST_X( <geography_or_geometry_expression> )
Copy
Arguments¶geography_or_geometry_expression
The argument must be an expression of the type GEOGRAPHY or GEOMETRY and must contain a Point.
Returns a REAL value.
Usage notes¶Issues an error if the argument is not a Point.
This shows a simple use of the ST_X and ST_Y functions with VARCHAR data:
SELECT ST_X(ST_MAKEPOINT(37.5, 45.5)), ST_Y(ST_MAKEPOINT(37.5, 45.5)); +--------------------------------+--------------------------------+ | ST_X(ST_MAKEPOINT(37.5, 45.5)) | ST_Y(ST_MAKEPOINT(37.5, 45.5)) | |--------------------------------+--------------------------------| | 37.5 | 45.5 | +--------------------------------+--------------------------------+Copy
This shows use of the ST_X and ST_Y functions with NULL values:
SELECT ST_X(ST_MAKEPOINT(NULL, NULL)), ST_X(NULL), ST_Y(ST_MAKEPOINT(NULL, NULL)), ST_Y(NULL) ; +--------------------------------+------------+--------------------------------+------------+ | ST_X(ST_MAKEPOINT(NULL, NULL)) | ST_X(NULL) | ST_Y(ST_MAKEPOINT(NULL, NULL)) | ST_Y(NULL) | |--------------------------------+------------+--------------------------------+------------| | NULL | NULL | NULL | NULL | +--------------------------------+------------+--------------------------------+------------+Copy
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4