I have the following query, that selects places withing given radius:
SELECT *
FROM (
SELECT
group,
name,
111.1111 *
DEGREES(ACOS(LEAST(1.0, COS(RADIANS(".$lat."))
* COS(RADIANS(t1.lat))
* COS(RADIANS(".$lon.") - RADIANS(t1.lon))
+ SIN(RADIANS(".$lat."))
* SIN(RADIANS(t1.lat))))) AS distance
FROM t1
) AS grp
WHERE distance < 10
It works well, but I'm not sure if returned results are in miles or kilometers. I suspect KM and if that's the case, how do I convert it to miles?
question from:
https://stackoverflow.com/questions/65835476/distance-units-in-a-query 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…