1 //lat 纬度在前(范围-90~90) 2 //lng 经度在后(范围-180~180) 3 4 select 5 id,lng,lat,jietime, 6 ROUND( 7 6378.138 * 2 * ASIN( 8 SQRT( 9 POW( 10 SIN( 11 ( 12 31.195392 * PI() / 180 - lat * PI() / 180 13 ) / 2 14 ), 15 2 16 ) + COS(31.195392 * PI() / 180) * COS(lat * PI() / 180) * POW( 17 SIN( 18 ( 19 121.453087 * PI() / 180 - lng * PI() / 180 20 ) / 2 21 ), 22 2 23 ) 24 ) 25 ) * 1000 26 ) AS juli 27 from lk_order having juli < 6000 28 ORDER BY jietime DESC 29 limit 0,5