# :include =\> :works, :select =\> ...

**URL:** <https://discuss.rubyonrails.org/t/include-works-select/9102>\
**Category:** rubyonrails-talk\
**Created:** [February 21, 2007, 5:18pm UTC](https://discuss.rubyonrails.org/t/include-works-select/9102 "2007-02-21T17:18:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chris\_Hall](https://avatars.discourse-cdn.com/v4/letter/c/0ea827/32.png) [@Chris\_Hall](https://discuss.rubyonrails.org/u/Chris_Hall)\
**Post date:** [February 21, 2007, 5:18pm UTC](https://discuss.rubyonrails.org/t/include-works-select/9102/1 "2007-02-21T17:18:35Z")

</div>

well, you're going to get a bunch of Client objects using find, however, you should only get the attributes you specify in the :select option, instead of all the attributes.

> > User.find(:all, :select =\> 'login')

=\> [#\<User:0xb771061c @attributes={"login"=\>"foo"}\>, #\<User:0xb77105e0 @attributes={"login"=\>"goo"}\>, #\<User:0xb77105a4 @attributes={"login"=\>"bar"}\>, #\<User:0xb7710568 @attributes={"login"=\>"baz"}\>]

> > User.find(:all, :select =\> 'login').collect { |u| u.login }

=\> ["foo", "goo", "bar", "baz"]

another option is to drop down into the connection and run your query, if you want to skip the above, but you'll have to write out your sql.

> > ActiveRecord::Base.connection.select\_value("select login from users")

=\> ["foo", "goo", "bar", "baz"]
