My query is
SELECT A.broker_property_id, A.broker_owner_id
FROM property_requirement_new AS A,
(SELECT X(latlong), Y(latlong)
FROM client_property_new
WHERE property_id = 132) AS B
WHERE (POW((A.X(latlong)-B.X(latlong))*111.12, 2) + POW((A.Y(latlong) - B.Y(latlong))*111.12, 2)) <= 4
Here, latlong
is a field of mysql's POINT
datatype.
But this query is not being executed and is showing the following error:
FUNCTION a.X does not exist
Can anyone help me out with the correct method to do it or to spot the error in my code?