I have this complex query that gives me Operand should contain 1 column(s)
error when executing. I know that this error means there are some un-needed brackets but I dont know which ones.
This is the query:
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