Distance is a numerical description of how far apart objects are.

Same as:

In most cases, “distance from A to B” is interchangeable with “distance between B and A”.



In physics or everyday usage, distance may refer to a physical length, or an estimation based on other criteria (e.g. “two counties over”).


In mathematics, a distance function or metric is a generalization of the concept of physical distance. A metric is a function that behaves according to a specific set of rules, and is a concrete way of describing what it means for elements of some space to be “close to” or “far away from” each other.

See also Data Mining - Similarity


Find all the hospitals within 5 miles of a school

with a theta join

select distinct h.name
from hospitals h, schools s
distance(h.location,s.location) < 5

Documentation / Reference

Powered by ComboStrap