码迷,mamicode.com
首页 > 数据库 > 详细

Sql根据经纬度算出距离

时间:2018-03-21 13:52:01      阅读:188      评论:0      收藏:0      [点我收藏+]

标签:body   gpo   tor   sql   not   根据   pos   经纬   select   

SELECT  ISNULL((2 * 6378.137 * ASIN(SQRT(POWER(SIN((117.223372- ISNULL(Latitude,0) )*PI()/360),2)+COS(117.223372*PI()/180)*COS(117.223372*PI()/180)*POWER(SIN((117.223372- ISNULL(Longitude,0) )*PI()/360),2)))),0)   AS Distance  FROM RequirementOrder r where r.RequirementOrderID not in (SELECT O.RequirementOrderID from OrdersDetail O)

Sql根据经纬度算出距离

标签:body   gpo   tor   sql   not   根据   pos   经纬   select   

原文地址:https://www.cnblogs.com/forget-remember/p/8616151.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!