I'm doing a query to get all the purchases from the db. For example
orders = PurchaseOrders.all
I in the same query, how can I select only the first hundred orders(1-100) or just the next 100(101-200) etc..?
You can use
which meant start from 200 and take 100 records. More info here. Or with
take 400 records starting from 100.
For the first 100 records;
orders = PurchaseOrders.first(100)
and last 100 records;
orders = PurchaseOrders.last(100)
or by IDs,
orders = PurchaseOrders.find([100, 201])