简体   繁体   中英

How to find area around my current point lat and long

I have a point with latitude and longitude as (current place). In my Database, I have many points (lat & long) which show me stores (for example). I need a SQL Server query to get stores which are near my current place with 5 Kilometers distance.

使用STDistance方法:

SELECT * FROM dbo.MyTable WHERE Location.STDistance(@CurrentPlace) <= 5000;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM