sql 计算两经纬度间的距离

DECLARE @g geography;
SET @g = geography::STPointFromText('POINT(113.216273 23.236333)', 4326);
SELECT @g.ToString();
DECLARE @gg geography;
SET @gg = geography::STPointFromText('POINT(115.567368 37.341209)', 4326);
SELECT @gg.ToString();

 

SELECT @g.STDistance(@gg)

posted @ 2014-07-24 18:21  不疼不痒,不吵不闹  阅读(245)  评论(0编辑  收藏  举报