I have a table that has the coordinates (latitude and longitude) of the users.
How do I make an appointment to bring people closer to the location.
Ex:
ID | Lat | Long
1 | -22.874428 | -43.372334
2 | -20.292799 | -40.301991
Bring these two where id 2 would be closest (search coordinates: -20.292799 | -40.301991)
I would like the query to bring something like
ID | Distancia
1 | 2km
2 | 20km
- the 2km and 20km would be calculated within the sql query