I have a web API that returns the next “set” of x number of items based on the ID of the last item that was recieved. So, if my last item ID was 30, and I want 50 more, then I should get IDs 31 – 81.
If I implement an SQL query that says SELECT * FROM table WHERE ID > 30 LIMIT 50, am I guaranteed to get IDs 31 – 81? Or, is there a way to do that? The ID column is AUTOINCREMENT.
Also, this is SQLite, specifically. I am not sure if that matters.
You should also order them by id before limiting the number of results