model.sum(:col,:group=>'col1,col2') only return 2 columns?

There are 3 columns in my model ‘Bank’:bank_name,money,save_year,and I
want to get the sum money group by bank_name and save_year.
However,Bank.sum(:money,:group=>‘bank_name,save_year’) just returns the
sum money and the save_year column,and
Bank.sum(:money,:group=>‘save_year,bank_name’) just returns the sum
money and the bank_name column!How can I get all of the three
columns?And it’s a rails feature or bug?My db is mysql,and the sql of
rails 2.1 generated returns all of the three columns in mysql query
Any help will be appreciated!

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs