The :order parameter defines the sorting order. : Map to SQL « ActiveRecord « Ruby






The :order parameter defines the sorting order.


Account.find :all, :order => "created_on DESC, last_name, first_name"

is 

SELECT * FROM accounts ORDER BY created_on DESC, last_name, first_name

 








Related examples in the same category

1.Group by clause
2.Aggregate function and group by
3.Left join
4.Left join on a column
5.Limit offset