Great Circle Distance Formula: T-SQL

后端 未结 3 1702
梦谈多话
梦谈多话 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条回答
  •  猫巷女王i
    2021-01-02 10:55

    you can just use the function directly in the SP... I was thinking:

    
    CREATE PROCEDURE [FindPlaces](@lat float, @long float, @min_dist float) 
    AS 
    
    select messageId from yourtable
    where dbo.F_GREAT_CIRCLE_DISTANCE(@lat, @long, lat, long) 
    

提交回复
热议问题