How can we use having keyword in WP_Query object of wordpress. Say for example if I want to have it like this:-
SELECT latitude, longitude, SQRT(
POW(69.1 * (latitude - [startlat]), 2) +
POW(69.1 * ([startlng] - longitude) * COS(latitude / 57.3), 2)) AS distance
FROM TableName HAVING distance < 25 ORDER BY distance;
Latitude and Longitude are already with me so to calculate runtime distance I want to do that using pagination. Any suggestions would be recommended.