使用between时出现语法错误

mrfwxfqh  于 2021-06-20  发布在  Mysql
关注(0)|答案(0)|浏览(262)

执行以下代码时。。。

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行的“–10/(111.04)”和(40.85093330+10/(111.04))以及sample_locations.longit”附近使用的正确语法(第4行是第一个开始之间的位置)

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题