SELECT cod,name_rus, country_id, region_id, rayon_rus, (abs((lon - 47.5)*(lon - 47.5)) + ABS((lat - 64.833)*(lat - 64.833)) ) as distance FROM city_guru WHERE cod < 100000000 and (abs((lon - 47.5)*(lon - 47.5)) + ABS((lat - 64.833)*(lat - 64.833)) )<10 and (abs((lon - 47.5)*(lon - 47.5)) + ABS((lat - 64.833)*(lat - 64.833)) ) >0.000001 ORDER BY `distance` ASC limit 1