I have a table with the geography type and I want to run a query to find all rows within 25 miles of a specific lat/long. What would the query look like to accomplish this?
This is how I did it:
select *
from local_events
where _your_geography_column_.STDistance(geography::Point(_your_lat_,_your_long_, 4326)) < ((_your_miles_ * 1000) * 0.621371192)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With