RE: Select coordinates which fall within a radius of a central point?

gfhgfhgfhfg

on January 5, 2017.
Add Comment
1 Answers

The SQL below should work:

SELECT*FROM Table1 a 
WHERE(
          acos(sin(a.Latitude *0.0175)* sin(YOUR_LATITUDE_X *0.0175)+ cos(a.Latitude *0.0175)* cos(YOUR_LATITUDE_X *0.0175)*    
                 cos((YOUR_LONGITUDE_Y *0.0175)-(a.Longitude *0.0175)))*3959<= YOUR_RADIUS_INMILES
      )
Answered on June 9, 2014.

aaaa

on June 9, 2014.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.