标签:
获取两个坐标间的SQL函数
http://tieba.baidu.com/p/1262843422
////////////////////
set global log_bin_trust_function_creators=1;
CREATE FUNCTION GetDistance
(lng1 float,lat1 float,lng2 float,lat2 float) RETURNS float
BEGIN
set @num=2 * 6378.137 * ASIN(SQRT(POW(SIN(PI() * (lat1 - lat2) / 360), 2) + COS(PI() * lat1 / 180) COS(lat2 PI() / 180) * POW(SIN(PI() * (lng1 - lng2) / 360), 2)));
RETURN @num*1000;
http://www.aiezu.com/db/mysql_gps_distance.html
====================
oracle
http://www.cnblogs.com/microsoft-jiang/archive/2008/07/24/1250644.html
标签:
原文地址:http://my.oschina.net/u/257088/blog/394098