Possible Duplicate:
Query to get records based on Radius in SQLite?
I am using sqlite to save latitude,longitude and video path in my application. by passing the current latitude and longitude as parameter in the query. i need to sort the video paths based
on the proximity. I am using the following query to achieve this SELECT videopath , ( 3959 * ACOS( COS( RADIANS( 12.9833 ) ) * COS( RADIANS( lat ) ) * COS( RADIANS( lng ) – RADIANS( 77.5833 ) ) + SIN( RADIANS( 12.9833 ) ) * SIN( RADIANS( lat ) ) ) ) AS distance FROM VideoPathsTable ORDER BY distance ASC LIMIT 0 , 30. In sql this query executes fine but in sqlite i am getting the following error no such function: ACOS is there any other alternate way to do this. Please help me to solve this issue.I am using libsqlite3.0.dylib
It looks like this is not part of the standart SQLite: Query to get records based on Radius in SQLite?
Check on SO before 🙂