This is an old revision of the document!
$DISTANCE calculates the distance between two geographical points.
$distance(lat1, long1, lat2, long2, options)
select $distance(40.0, -105.0, 41.0, -106.0) from $omnidex
select $distance(40.0, -105.0, latitude, longitude), latitude, longitude, from geo where $distance(40.0, -105.0, latitude, longitude) < 10
select latitude, longitude, from geo where $distance((select latitude, longitude from zipcodes where zip = ‘80301’), latitude, longitude) < 10
select latitude, longitude, from geo where $distance((select latitude, longitude from zipcodes where region = ‘MT’), latitude, longitude) < 10