Advertisements
I need to run a script that will return cities that match within a certain range of the latitude and longitude. We are trying to check to make sure what we return for lat/log matches close to what our sources have. I am trying to get my statement to return only if the lat/long is falls within a 1.0 range. I cant seem to get the results to work correctly. Below is my where statement and i have lat/long as float. Any help would be greatly appreciated.Thanks
where (g.city = a.city) and (g.region = a.iso2) and source <> 'geopc' and (g.lat >= (a.lat + (-0.5)) and g.log >= (a.lng + (-0.5)) or g.lat <= (a.lat - (-0.5)) and g.log <= (a.lng - (-0.5)))