Created
December 1, 2021 04:56
-
-
Save silentsudo/6d1a96c7fd3de5b4a15a65c5b6ebef9b to your computer and use it in GitHub Desktop.
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 | |
id, | |
address, | |
(6371 * | |
ACOS(COS(RADIANS(12.972442)) * COS(RADIANS(latitude)) * COS(RADIANS(longitude) - | |
RADIANS(77.580643)) + SIN(RADIANS(12.972442)) * SIN(RADIANS(latitude)))) AS distance | |
FROM | |
address | |
HAVING distance < 5 | |
ORDER BY distance |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment