SELECT cuisine, count(cuisine) as sum
FROM
(
SELECT cuisine, (6731 * acos(cos(radians('45.2927679')) * cos(radians(latitude)) * cos(radians(longitude) - radians('-75.7308939')) + sin(radians('45.2927679')) * sin(radians(latitude)))) AS distance
FROM restaurants
where (legal_name like '%%' OR description like '%%')
) SQ
WHERE distance < 20
group by cuisine