Last active
December 27, 2017 16:31
-
-
Save imrealashu/4cf8f4625768e7345bf23b2025c78f99 to your computer and use it in GitHub Desktop.
Mysql raw query for spacial distance calculations.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT *, | |
ST_DISTANCE_SPHERE( | |
POINT(`table_name`.`lat`, `table_name`.`lng`), | |
POINT('24.2449530', '85.4870880')) as `distance` | |
FROM `table_name |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment