# About find the newly created 10 users

**URL:** <https://www.ruby-forum.com/t/about-find-the-newly-created-10-users/196737>\
**Category:** Rails\
**Created:** [July 7, 2008, 5:01pm UTC](https://www.ruby-forum.com/t/about-find-the-newly-created-10-users/196737 "2008-07-07T17:01:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![daociyiyou](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/0ea827/32.png) [@daociyiyou](https://www.ruby-forum.com/u/daociyiyou)\
**Post date:** [July 7, 2008, 5:01pm UTC](https://www.ruby-forum.com/t/about-find-the-newly-created-10-users/196737/1 "2008-07-07T17:01:50Z")

</div>

hello:  
How do i find the newly created 10 users in the database?Now i only  
know the way:  
1.users=User.find(:all,:order=\>“created\_at DESC,id”)  
2.then get the first 10 users from the array  
I think this way is not the best one for getting all the records  
everytime.  
Anyone can help me?

---

<div class="post-metadata">

**Author:** ![daociyiyou](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/0ea827/32.png) [@daociyiyou](https://www.ruby-forum.com/u/daociyiyou)\
**Post date:** [July 7, 2008, 5:09pm UTC](https://www.ruby-forum.com/t/about-find-the-newly-created-10-users/196737/2 "2008-07-07T17:09:27Z")

</div>

just use the :limit attribute

users=User.find(:all,:order=\>“created\_at DESC,id”, :limit =\> 10)

---

<div class="post-metadata">

**Author:** ![daociyiyou](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/0ea827/32.png) [@daociyiyou](https://www.ruby-forum.com/u/daociyiyou)\
**Post date:** [July 7, 2008, 5:40pm UTC](https://www.ruby-forum.com/t/about-find-the-newly-created-10-users/196737/3 "2008-07-07T17:40:35Z")

</div>

Thorsten M. wrote:

> just use the :limit attribute
> 
> users=User.find(:all,:order=\>“created\_at DESC,id”, :limit =\> 10)

Thank you,i misunderstand the :order param.
