Z
Z
Zaur Ashurbekov2017-09-24 21:39:47
Ruby on Rails
Zaur Ashurbekov, 2017-09-24 21:39:47

How to get k records starting from position n?

Hello Toaster!
Actually interesting something like model.find( from: n, number: k)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
oh_shi, 2017-09-24
@zaurius

User.where("id > ?", n).limit(k)
User.where(id: n..k)
User.offset(n).limit(k)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question