Great Circle Distance Formula: T-SQL

后端 未结 3 1704
梦谈多话
梦谈多话 2021-01-02 10:06

So I have a table with a bunch of different addresses in it. I need a proc that will select the addresses in that table that are within a specified distance in miles from th

3条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-02 10:59

    SQL Server 2008

    Using the spacial function STDistance return distance in meters

    geography::Point(@lat1, @lon1, 4326).STDistance(geography::Point(@lat2, @lon2, 4326))

提交回复
热议问题