mysql 表名bars,字段lat为纬度,lng为经度
传入参数 纬度40.0497810000,经度116.3424590000,查询表内距离自己最近的酒吧
SELECT*,ROUND(6378.138*2*ASIN(SQRT(POW(SIN((40.0497810000*PI()/180-lat*PI()/180)/2),2)+COS(40.0497810000*PI()/180)*COS(lat*PI()/180)*POW(SIN((116.3424590000*PI()/180-lng*PI()/180)/2),2)))*1000)ASdistanceFROMbarsWHERElat!='0'orlng!='0'ORDERBYdistanceASCLIMIT0,100