Geo Functions
Built-in functions for location-based queries and distance calculations
GEO_DISTANCE
Syntax
GEO_DISTANCE(lat1, lng1, lat2, lng2)Parameter
Type
Description
Examples
SELECT
store_name,
city,
GEO_DISTANCE(48.8566, 2.3522, store_lat, store_lng) AS distance_from_paris_km
FROM retail_stores
ORDER BY distance_from_paris_km ASCGEO_WITHIN_RADIUS
Syntax
Parameter
Type
Description
Examples
Combining both functions
Notes
Last updated