My business partner and I are having issues selecting from a MySQL view that has a HAVING clause.
The query simply selects a few fields from the view, determines a
Try this:
select * from (
SELECT
restaurantName,
restaurantID,
locationID,
locationCity,
locationState,
locationAddress,
locationLatitude,
locationLongitude,
( 3959 * acos( cos( radians('%s') ) * cos( radians( locationLatitude ) ) * cos( radians( locationLongitude ) - radians('%s') ) + sin( radians('%s') ) * sin( radians( locationLatitude ) ) ) ) AS distance
FROM newView
) S
where distance < '%s'
ORDER BY distance