I have a SQLite table with fields Latitude and Longitude (neg and pos numbers)
I have a latitude *delta* and a longitude *delta* of (for example ’23’) based on a Latitude of 50 and a longitude of 75 (again, for example)
How do I query the table for a list of all records which are + or – 23 latitudes and + or – 23 longitudes when there are both positive and negative latitude and longitude values in the table.
The lat/long fields are of type NUMERIC and are indexed ASC.
select [fields]
from [table]
where latitude of 50 -+23 and
longitude of 75 -+23
If you’re using an ORM between you and the database, or a programming language on top of the DB, you might be able to do steps 1 and 2 on the fly, thereby only executing one DB query in step 3.