ST_DISTANCE
functionsupportedCore SQL functionsReturns the minimum great circle distance between two GEOGRAPHY or the minimum Euclidean distance between two GEOMETRY objects.
Syntax
ST_DISTANCE( <geography_or_geometry_expression_1> , <geography_or_geometry_expression_2> )
Parameters
| Name | Required | Description |
|---|---|---|
geography_or_geometry_expression_1 | required | The argument must be of type GEOGRAPHY or GEOMETRY. |
geography_or_geometry_expression_2 | required | The argument must be of type GEOGRAPHY or GEOMETRY. |
Returns
Returns a FLOAT value, which represents the distance, or NULL: - For GEOGRAPHY input values, the distance is in meters. - For GEOMETRY input values, the distance is computed with the same units used to define the input coordinates. - Returns NULL if one or more input points are NULL.
Usage notes
- For GEOMETRY objects, the function reports an error if the two input GEOMETRY objects have different SRIDs.