Use "LIMIT" and "OFFSET" within your query.
select * from sometable offset = 0 and limit = 20
That will pull your first 20 results
Then on the next page pass it the new offset and query it again.
appending...
ok I'm still asleep... I didn't read your comment very well 🙁 my bad