How to calculate distance using latitude and longitude?
I have table having latitude and longitude Lat Longitude 40.8151 -73.0455 U 36103 40.8132 -73.0476 U 36103 So what i want is I am passing two Longitude and latitude from my page How can i find nearest place using store procedure i don't have a much hand on it so i have to ask here Tried using this one ( 3959 * acos( cos( radians(37) ) * cos( radians( @latitude ) ) * cos( radians( @longtitude ) - radians(-122) ) + sin( radians(37) ) * sin( radians( @latitude ) ) ) ) But i have to match it with the table values so how can i achieve this? SELECT ROUND(6371 * acos(cos(radians('lat')) * cos(radians