/ Published in: MySQL
Get closest location to a set of gps coordinates (x, y) given a database table with columns lat(latitude) and lng(longitude)
Expand |
Embed | Plain Text
SELECT * FROM tb_location ORDER BY SQRT(POWER((y-lng), 2)+POWER((x-lat),2)) ASC LIMIT 1;
You need to login to post a comment.
