Lat Lon Distance Calculation query in Oracle(Oracle 中的经纬度距离计算查询)
问题描述
我有一个 Oracle 11g 数据库.我存储纬度和经度(比如商店或商店).现在我需要一个查询来计算商店和我的位置之间的距离(我将在查询中提供).我之前在 MySQL 中做过这个,但是在 Oracle 中没有 Radians 函数.所以我需要在 Oracle SQL 中工作.
I have a Oracle 11g DB. I store Latitude and Longitudes (for lets say stores or shops). Now i need a query which will calculate the distance between the shops and my location(which i will provide in the query). I have done this earlier in MySQL, but in Oracle there is no Radians function. So i need work aronud in Oracle SQL.
感谢帮助.谢谢.
推荐答案
创建一个将度数转换为弧度的函数:
Create a function that converts degrees to radians:
CREATE OR REPLACE FUNCTION degree_to_radian(p_degree IN NUMBER)
RETURN NUMBER IS
BEGIN
RETURN p_degree / 57.2957795;
END degree_to_radian;
这篇关于Oracle 中的经纬度距离计算查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Oracle 中的经纬度距离计算查询
基础教程推荐
- 在多列上分布任意行 2021-01-01
- 什么是 orradiag_<user>文件夹? 2022-01-01
- mysql选择动态行值作为列名,另一列作为值 2021-01-01
- oracle区分大小写的原因? 2021-01-01
- 如何在 SQL 中将 Float 转换为 Varchar 2021-01-01
- MySQL 中的类型:BigInt(20) 与 Int(20) 2021-01-01
- 表 './mysql/proc' 被标记为崩溃,应该修复 2022-01-01
- 二进制文件到 SQL 数据库 Apache Camel 2021-01-01
- 如何根据该 XML 中的值更新 SQL 中的 XML 2021-01-01
- 在 MySQL 中:如何将表名作为存储过程和/或函数参数传递? 2021-01-01
