惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
Secure Thoughts
罗磊的独立博客
T
The Blog of Author Tim Ferriss
人人都是产品经理
人人都是产品经理
博客园 - 叶小钗
Last Week in AI
Last Week in AI
美团技术团队
Google Online Security Blog
Google Online Security Blog
Application and Cybersecurity Blog
Application and Cybersecurity Blog
D
Docker
G
Google Developers Blog
大猫的无限游戏
大猫的无限游戏
酷 壳 – CoolShell
酷 壳 – CoolShell
小众软件
小众软件
月光博客
月光博客
L
LINUX DO - 最新话题
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
W
WeLiveSecurity
H
Heimdal Security Blog
Vercel News
Vercel News
SecWiki News
SecWiki News
Forbes - Security
Forbes - Security
Blog — PlanetScale
Blog — PlanetScale
Google DeepMind News
Google DeepMind News
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
www.infosecurity-magazine.com
www.infosecurity-magazine.com
TaoSecurity Blog
TaoSecurity Blog
T
Troy Hunt's Blog
A
About on SuperTechFans
C
Check Point Blog
S
Security Affairs
Hacker News - Newest:
Hacker News - Newest: "LLM"
AI
AI
WordPress大学
WordPress大学
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Help Net Security
Help Net Security
博客园_首页
The Last Watchdog
The Last Watchdog
S
SegmentFault 最新的问题
Hugging Face - Blog
Hugging Face - Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
Engineering at Meta
Engineering at Meta
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
I
Intezer
K
Kaspersky official blog
M
MIT News - Artificial intelligence
J
Java Code Geeks
G
GRAHAM CLULEY
P
Palo Alto Networks Blog

博客园 - Future.Net博客

WIN11 EDGE IE8调试 部署asp.net core6 iis InProcess模式方法 百度地图 iis pdf cMaps 404问题临时解决 小程序刷新 mvc5 添加 MapMvcAttributeRoutes 并且 html访问 SQL Server 错误9002 日志已满解决 C# null 合并运算符??(双问号)使用示例 ASP.NET第一次访问慢的解决方法(MVC,Web Api) 利用百度地图接口,制作一键导航功能 ASP.NET MVC 利用路由规则自定义管理后台登录地址 SQL server数据库 显示 正在还原 如何让ASP.NET网站站点不停止 永远持续运行 $.post() 和 $.get() 如何同步请求 获取表单所有字段 Post c# Split 使用@符号让C#中的保留字做变量名的方法详解 js 平均分割 string[] 转换为 int[]
sqlserver 根据经纬度计算两点之间距离
Future.Net博客 · 2020-03-18 · via 博客园 - Future.Net博客

计算函数:
–计算地球上两个坐标点(经度,纬度)之间距离sql函数 –作者:lordbaby –整理:www.aspbc.com
CREATE FUNCTION [dbo].[fnGetDistance](@LatBegin REAL, @LngBegin REAL, @LatEnd REAL, @LngEnd REAL)
RETURNS FLOAT
AS
BEGIN
–距离(千米)
DECLARE @Distance REAL
DECLARE @EARTH_RADIUS REAL
SET @EARTH_RADIUS = 6378.137
DECLARE @RadLatBegin REAL,@RadLatEnd REAL,@RadLatDiff REAL,@RadLngDiff REAL
SET @RadLatBegin = @LatBegin *PI()/180.0
SET @RadLatEnd = @LatEnd *PI()/180.0
SET @RadLatDiff = @RadLatBegin - @RadLatEnd
SET @RadLngDiff = @LngBegin *PI()/180.0 - @LngEnd *PI()/180.0
SET @Distance = 2 *ASIN(SQRT(POWER(SIN(@RadLatDiff/2), 2)+COS(@RadLatBegin)*COS(@RadLatEnd)*POWER(SIN(@RadLngDiff/2), 2)))
SET @Distance = @Distance * @EARTH_RADIUS
–SET @Distance = Round(@Distance * 10000) / 10000
RETURN @Distance
END

使用方法如下:

SELECT * FROM 表名 WHERE dbo.fnGetDistance(108.89382764697076,34.16389439109832,longitude,latitude) < 5
————————————————
版权声明:本文为CSDN博主「Ms___」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/Ms___/article/details/78780705