Several databases will offer you some GIS functions, hence look at those.
If you want to compute using SQL expressions, if your system has the trig functions.
The distance between lat and long points can be derived using the Haversine formula
DEGREES(ACOS(COS(RADIANS(lat1)) * COS(RADIANS(lat2)) * COS(RADIANS(long1) - RADIANS(long2)) + SIN(RADIANS(lat1)) * SIN(RADIANS(lat2))))
Multiplying value by constant to change units
- Kilometers = 111.045
- Meters = 111045.0
- Miles = 69.0
------------------------------
NIGEL CAMPBELL
------------------------------