I’m using redash and my table looks something like this. I’m just learning sql. This is very advanced for me. I searched many questions, no queries worked for me
|user_id | long | lat |
|1 |31.000|26.000|
|2 |30.000|25,000|
|3 |30.003|25,007|
I need to get all the customers that used my service in this point and a radius of 1 km as well my table looks something like this one written above
adding that point of user 1 is my cennter point
2
Answers
It is hard task just because longitude 1 is the different number of kilometers on different areas(zero on pole, 111km on equator).
So most likely you have first filter your data using some values in the range for your country, after that use some specialized library to calculate the exact distance.
If you have exact point before search, you have to
you can use spatial functions