so I have two tabels where one has a list of all postcodes with long and lat and the other has store data with long and lat.
What I need to know is how do I find all the stores that match the long and lat from a postcode within 30km
so I have two tabels where one has a list of all postcodes with long and lat and the other has store data with long and lat.
What I need to know is how do I find all the stores that match the long and lat from a postcode within 30km
Use the Haversine formula (MySQL implementation) to calculate the distance between them. Return rows which have a distance of less or equal to 30
.
Review this http://jan.ucc.nau.edu/~cvm/latlon_formula.html for formula, and put the formula on select statement and order by the distance