# Active record sum vs find

**URL:** <https://www.ruby-forum.com/t/active-record-sum-vs-find/149970>\
**Category:** Rails\
**Created:** [October 1, 2008, 9:08pm UTC](https://www.ruby-forum.com/t/active-record-sum-vs-find/149970 "2008-10-01T21:08:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![banry](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/898d66/32.png) [@banry](https://www.ruby-forum.com/u/banry)\
**Post date:** [October 1, 2008, 9:08pm UTC](https://www.ruby-forum.com/t/active-record-sum-vs-find/149970/1 "2008-10-01T21:08:01Z")

</div>

Hi, I’m a newbie, i’m trying to do something I think should be trival  
but havring great difficulty so any help appreciated.

sum(amounts) group by director, risk

output to be director, risk, amounts

i’ve tried find with :select

and almost got it right with sum

using  
sum(:amount, :group =\> ‘director, risk’, :order =\> ‘director,  
risk’,  
:conditions =\> [‘company\_id = ?’])

but this does not output the director only [[10,50], [20,50],  
[10,50]…

Any help appreciated
