The ST_X function takes a point as an
input parameter and returns its X coordinate. You can optionally indicate
an X coordinate as input parameter in addition to the point and the
function returns the point itself with its X coordinate set to the
specified value.
If the specified point is null or is empty, then null is returned.
Syntax
Parameters
point
A value of type ST_Point for which the X coordinate is returned
or modified.
x_coordinate
A value of type DOUBLE that represents the new X coordinate for point.
Return types
DOUBLE, if x_coordinate is not specified
ST_Point, if x_coordinate is specified
Examples
Example 1
This example illustrates use of the ST_X function. Geometries
are created and inserted into the SAMPLE_POINTS table.