I must obtain a SQLite SQL Sentence for ordering by nearest latitude and longitude coordinates, given a initial location.
THis is a example sentence for my table in the sqlite database:
SELECT id, name, lat, lng FROM items
EXAMPLE RESULT: 1, Museu, 41375310.0, 2175970.0
SELECT * AS distance FROM items ORDER BY ABS(location_lat - lat) + ABS(location_lng - lng) ASC
This should roughly sort the items on distance in MySQL, and should work in SQLite.
If you need to sort them preciser, you could try using the Pythagorean theorem (a^2 + b^2 = c^2) to get the exact distance.