How to retrieve all rows thats co-ords are within a specifc radius in MySql Database
i am looking for a select statement that when given a specific set of co-ords(lng1+lat1) it will return a开发者_C百科ll the rows within a 1km radius of lng1+lat1? this is to work with a mysql server?
|_id_|_lat_|lng_|
row 1 | 1 | 1.3 |5.3 |
row 2 | 2 | 1.3 |5.2 |
row 3 | 3 | 2.3 |5.9 |
select * from table where POW((_lat_-lat1),2) + POW((_lng_-lng1),2) < 1
精彩评论