Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/72.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Mysql 在使用between时出现语法错误_Mysql_Syntax_Between - Fatal编程技术网

Mysql 在使用between时出现语法错误

Mysql 在使用between时出现语法错误,mysql,syntax,between,Mysql,Syntax,Between,执行以下代码时 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)),

执行以下代码时

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服务器版本相对应的手册,以了解在“–10/111.04和40.8509330+10/111.04附近使用的正确语法以及示例_位置。第4行第4行的longit”是第一个开始位置


为什么有没有任何聚合的子句?这不是问题所在,因为我在没有WHERE子句的情况下运行语句,并且它成功地执行了。-字符似乎没有被解释为-减法符号,请更改它。