mysql 查询地图坐标距离

 

ACOS(SIN((:lat*3.1415)/180 )*SIN((a.latitude*3.1415)/180 )+COS((:lat*3.1415)/180 )*COS((a.latitude*3.1415)/180)*COS((:lng*3.1415)/180-(a.longitude*3.1415)/180))*6380 as distance



select  ACOS(SIN((39*3.1415)/180 )*SIN((bs.latitude*3.1415)/180 )+COS((39*3.1415)/180 )*COS((bs.latitude*3.1415)/180)*COS((116*3.1415)/180-(bs.longitude*3.1415)/180))*6380 as distance,


bs.*
  from ybt_stock s  left join ybt_business  bs on s.business_id = bs.id
 

你可能感兴趣的:(mysql,地图)