Maybe I just can't think right currently. But what I want to try and figure out is how can I return a set of results that is the count of rows per category, in the DB. Without having to query based on each category.
The categories in this case are states. I have 90,000 rows of data with 50 different states dividing the data up. Is there a way of creating a count that is associated with each state?
I want to say group_by or something but I just honestly can't think of it right now. Ideas?
member | comment | state | dataset
----------------------------------
000 |something| CA | an_object_of_data
000 |something| CA | an_object_of_data
000 |something| CA | an_object_of_data
000 |something| NY | an_object_of_data
000 |something| NY | an_object_of_data
000 |something| CA | an_object_of_data
000 |something| CT | an_object_of_data
000 |something| CA | an_object_of_data
the above is an example of the db table in sorts. Imagine something like that with 90k rows and more state.
If I can some how get a count returned by grouping the results or something, ie: "CA=4", "CT=1", "NY=2"