我有这个复杂的查询,Operand should contain 1 column(s)
执行时会出错。我知道这个错误意味着有一些不需要的括号,但我不知道是哪些。
这是查询:
SELECT
*
FROM
deals
WHERE
country_id = 2 AND
(city_id = 4 OR city_id = 0) AND
section_id = 2 AND
id IN (
SELECT
deal_id
FROM
deal_repeat
WHERE
start_date = '2013-06-14') AND
business_id IN (
SELECT
*, ( 3959 * acos( cos( radians('51') ) * cos( radians( lat ) ) * cos( radians( lng ) - radians('-114') ) + sin( radians('51') ) * sin( radians( lat ) ) ) ) AS distance
FROM
address
HAVING
distance < '25'
)
ORDER BY id DESC