转自 http://www.edbiji.com/doccenter/showdoc/10/nav/2985.html
#当前位置经纬度 经度:120.388526 纬度:36.090613 #表中经纬度字段 经度:longitude 纬度:latitude #6378.138 * 2 为地球的直径 固定值 SELECT * FROM ( SELECT id, NAME, longitude, latitude, ROUND( 6378.138 * 2 * ASIN( SQRT( POW( SIN( ( 36.090613 * PI() / 180 - latitude * PI() / 180 ) / 2 ), 2 ) + COS(36.090613 * PI() / 180) * COS(latitude * PI() / 180) * POW( SIN( ( 120.388526 * PI() / 180 - longitude * PI() / 180 ) / 2 ), 2 ) ) ) * 1000 ) AS juli FROM kj_maps_test ) AS tmp_table_name -- WHERE -- juli < 1000 ORDER BY juli