I want to fetch the data in chunks (using a select
query) like in first attempt from 1 to 50 records and in second attempt from 51 to 100 records.
Use LIMIT
and OFFSET
. The following query returns 50 records after skipping the first 50, so records 51 - 150 are returned.
SELECT fname, lname
FROM students
ORDER BY ssn
LIMIT 100 OFFSET 50;
https://www.postgresql.org/docs/current/static/queries-limit.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With