开发者

ActiveRecord query help .count

I have a DB table users that has the following columns: id, clan_id, experience

I want to run a开发者_Go百科 query using rails that returns the top 50 clans based on experience. How would you do this query in rails?

Clan Table to User Table is a one to many relationship. Thus a clan is composed of multiple users that have the same id.


Clan.find(:all, :order => "experience DESC", :limit => 50)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜