-2

I want to calculate the distance between current row latitude and longitude with next row latitude and longitude using SQL Server. Here is my table:

+----+-----------+------------+----------+
| ID |    lat    |    lon     | distance |
+----+-----------+------------+----------+
|  1 | 12.64464  | 77.56497   | 15.446   |
|  2 | 12.9897   | 77.8989    | 16.46    |
|  3 | 12.898    | 77.4478979 | 17.89    |
|  4 | 12.646879 | 77.689897  | 18.47    |
+----+-----------+------------+----------+
jarlh
  • 42,561
  • 8
  • 45
  • 63
GPAdiga
  • 9
  • 5

1 Answers1

0

Refer to Calculate distance, bearing and more between Latitude/Longitude points page. It might give you the solution that you are looking for.

Prasanna
  • 1,184
  • 8
  • 12