I want to do the following query:
SELECT getDistance(lat1, lng1, lat2, lng2) as `distance`, `forename`, `surname`, `etc..`
WHERE `distance` < 10
ORDER BY `distance` ASC
Obviously it won't work because you cannot do WHERE
clauses on column 'alias'... can anyone help with an alternative??
getDistance()
is a custom procedure... this returns the distance in miles between 2 sets of coordinates. (it is a implementation of http://en.wikipedia.org/wiki/Great-circle_distance)...
Many thanks.