我想获得 10 个最近的经度和纬度位置。我将经度和纬度存储为双倍。我试过这个:
SELECT * FROM company as dest where 3956 * 2 * ASIN(SQRT( POWER(SIN((122.4058 - abs( dest.latitude)) * pi()/180 / 2),2) + COS(122.4058 * pi()/180 ) * COS( abs (dest.latitude) * pi()/180) * POWER(SIN((37.7907 – dest.longitude) * pi()/180 / 2), 2) )) as dis <10 and ORDER BY dis limit 10;
但我收到此错误:
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '– dest.longitude) * pi()/180 / 2), 2) )) as dis <10 and ORDER BY dis limit 10 ' at line 1
如何解决这个错误?