执行以下代码时...
SELECT city,
6371 * 2 * ASIN(SQRT(POWER(SIN(RADIANS(40.85093330 - ABS(sample_locations.latitude))), 2) + COS(RADIANS(40.85093330)) * COS(RADIANS(ABS(sample_locations.latitude))) * POWER(SIN(RADIANS(-73.97013820 - sample_locations.longitude)), 2))) AS distance
FROM sample_locations
WHERE sample_locations.latitude BETWEEN (40.85093330 – 10 / (111.04)) AND (40.85093330 + 10 / (111.04)) AND sample_locations.longitude BETWEEN (-73.97013820 – 10 / ABS(COS(RADIANS(40.85093330)) * 111.04)) AND (-73.97013820 + 10 / ABS(COS(RADIANS(40.85093330)) * 111.04))
HAVING distance < 10
ORDER BY distance LIMIT 10;
我收到错误消息...
#1064-您的SQL语法有错误;检查与您的MariaDB服务器版本相对应的手册,以在第4行(第4行是第一个在两次之间)