SELECT link_id, a.lat, a.lon, a.map_name, townsearch, sitemap_small,st_distance_sphere(st_srid(point('-95.712891','37.09024'),4326),st_srid(point(a.lon,a.lat),4326)) / 1000 AS distance FROM -- sb.search_lat_lon a locales a WHERE -- ABS(37.09024 - a.lat) < 2 AND ABS(-95.712891 - a.lon) < 3 ST_Intersects(a.latlon, ST_BUFFER(st_srid(POINT(-95.712891, 37.09024),4326),100*1000)) /* distance 100*/ HAVING sitemap_small =1 AND distance < 15 OR townsearch =1 AND sitemap_small = 0 ORDER BY sitemap_small DESC, townsearch DESC, distance ASC LIMIT 1
this venue could not be found