Hello everyone,

Let's say I have the following set of data in my database table:

Cars table

-------------------------------------
[Brand]      [Type]
Mercedes     CL63
BMW          M3
Mercedes     CL63
Audi         RS4
BMW          M3
BMW          M3
-------------------------------------

I would like to know how many cartypes I have of a particular brand.
So in this case I would expect an output something like:

2x Mercedes CL63
3x BMW M3
1x Audi RS4

How can I generate such an output? I have really no clue how to start.
Suggestions, tips that can pull me in the right direction are welcome.

Thanks a bunch.

John

-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to