Limit offset : Map to SQL « ActiveRecord « Ruby





Limit offset


Account.find :all, :limit => 10, :offset => 20

And the following SQL query will result:

SELECT * FROM accounts LIMIT 10 OFFSET 20

 

Related examples in the same category

1.The :order parameter defines the sorting order.
2.Group by clause
3.Aggregate function and group by
4.Left join
5.Left join on a column