I'm trying to get some stats from my database about my model, and I'm not sure how to go about it.
If I have a model 'foo' that has an attribute 'color' and I want to get some counts on this I could use the sql:
SELECT color, COUNT(*) AS count
GROUP BY status
which would return something like: