Skip to content

Instantly share code, notes, and snippets.

@slav123
Created June 9, 2020 13:02
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 slav123/3e73a860ba14661d5d7026a9783a64d2 to your computer and use it in GitHub Desktop.
Save slav123/3e73a860ba14661d5d7026a9783a64d2 to your computer and use it in GitHub Desktop.
distance-km-sql.sql
(6371 * acos ( cos ( radians(' . $address['latitude'] . ') ) * cos( radians( clients.latitude ) ) * cos( radians( clients.longitude ) - radians(' . $address['longitude'] . ') ) + sin ( radians(' . $address['latitude'] . ') ) * sin( radians( clients.latitude ) ) ) ) AS distance_adv'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment