A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.snowflake.com/en/sql-reference/functions/st_x below:

Website Navigation


ST_X | Snowflake Documentation

Categories:

Geospatial functions

ST_X

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

Returns a REAL value.

Usage notes Examples GEOGRAPHY examples

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