Hello,

I have a table called "Itemlist" and have multiple columns in it such as
"item1", "item2", "item3", "item4". These columns often have repetitious
data between them and I'm trying to count it. The only working code I
have so far is:

statcount = Itemlist.count(:all, :condition => {:item1 => "Apple"})

And this works fine for retrieving the count for "Apple" in all the
:item1 fields, but I need to retrieve the count for "Apple" from the
columns :item2, :item3, and :item4 as well as :item1. Any ideas? Thanks!
-- 
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 rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to