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 |
+----+-----------+------------+----------+