运行此查询时出现以下错误:
SELECT count(*) AS COUNT,
((ACOS(SIN(
(SELECT latitude
FROM cities
WHERE name = 'london' & country = 'gb')*PI()/180) *
SIN((cities.latitude)*PI()/180)+COS(
(SELECT latitude
FROM cities
WHERE name = 'london' && country = 'gb')*PI()/180)*COS((cities.latitude)*PI()/180)*COS((
(SELECT longitude
FROM cities
WHERE name = 'london' && country = 'gb')-
(cities.longitude))*PI()/180))*180/PI())*60*1.1515) AS distance
FROM tbl_products
LEFT JOIN members ON tbl_products.seller = members.id
LEFT JOIN business ON tbl_products.seller = business.bid
INNER JOIN cars ON tbl_products.prod_id = cars.prod_id
LEFT JOIN car ON cars.car = car.id
LEFT JOIN cities ON members.location = cities.id
LEFT JOIN regions ON cities.region = regions.code && cities.country = regions.country
WHERE tbl_products.title LIKE '%|mazda%' ESCAPE '|'
OR tbl_products.description LIKE '%|mazda%' ESCAPE '|' && regions.country = 'gb' HAVING distance <= '30';
子查询返回超过 1 行。
我只是想知道如何在给定距离内检索记录。