Skip to content

Instantly share code, notes, and snippets.

@tonyblundell
Created September 29, 2014 14:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tonyblundell/c25af3cbb945a4b0aedc to your computer and use it in GitHub Desktop.
Save tonyblundell/c25af3cbb945a4b0aedc to your computer and use it in GitHub Desktop.
SQL lat/long distance(mi) calc
3959 * ACOS(COS(RADIANS(lat1)) * COS(RADIANS(lat2)) *
COS(RADIANS(long2) - RADIANS(long1)) +
SIN(RADIANS(lat1)) * SIN(RADIANS(lat2)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment