MySQL Forums
Forum List  »  GIS

mysql WGS84 Data & distance queries
Posted by: Alan Young
Date: December 02, 2010 08:43AM

I am trying to execute this mysql query can any one help me please with this

SELECT *, 3956 * 2 * ASIN(SQRT(POWER(SIN((53.65274 - Lat) * pi()/180 / 2), 2) + COS(53.65274 * pi()/180) *COS(Lat * pi()/180) * POWER(SIN((-2.63241 -Long) * pi()/180 / 2), 2))) as distance FROM hotels

#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 'Long) * pi()/180 / 2), 2))) as distance FROM BeautySalson LIMIT 0, 30' at line 1

I have table called hotels with fields Lat and Long my original gps lat/Long are (53.65274, -2.63241)

I don't know if I am doing this right

Options: ReplyQuote

Written By
mysql WGS84 Data & distance queries
December 02, 2010 08:43AM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.