select fm."Name", count(fb.id) from districts_fatih_mahalle fm, buildings_fatih_bina fb where st_intersects(fm.geom,st_pointonsurface(fb.geom)) and fm.geom && fb.geom group by fm.id order by count(fb.id) desc limit 3; Name Count "AYVANSARAY" 1903 "BALAT" 1555 "KOCAMUSTAFAPAŞA" 1457