Answers for "how to get nears location in mysql with latitude and longitude"

SQL
0

how to get nears location in mysql with latitude and longitude

SELECT latitude, longitude, address_1, SQRT(
    POW(69.1 * (latitude - [starlat]), 2) +
    POW(69.1 * ([startlng] - longitude) * COS(latitude / 57.3), 2)) AS distance
FROM address HAVING distance < 25 ORDER BY distance

-- where [starlat] and [startlng] is the position where to start measuring the distance.
Posted by: Guest on April-02-2022

Code answers related to "how to get nears location in mysql with latitude and longitude"

Code answers related to "SQL"

Browse Popular Code Answers by Language