Skip to content

Returns the minimum Euclidean distance between two GEOMETRY objects.

ST_DISTANCE(<geometry1>, <geometry2>)
ArgumentsDescription
<geometry1>The argument must be an expression of type GEOMETRY and must contain a Point.
<geometry2>The argument must be an expression of type GEOMETRY and must contain a Point.

Double.

SELECT
ST_DISTANCE(
TO_GEOMETRY('POINT(0 0)'),
TO_GEOMETRY('POINT(1 1)')
) AS distance
┌─────────────┐
│ distance │
├─────────────┤
1.414213562
└─────────────┘