Topic: Group and count

I am trying to find out how many rows share a common element  and i am using a PG database

in my controller i have

  Problem.group(:event_date)

Output

SELECT "problems".* FROM "problems" GROUP BY event_date
ActiveRecord::StatementInvalid: PG::Error: ERROR:  column "problems.id" must appear in the GROUP BY clause or be used in an aggregate function
LINE 1: SELECT "problems".* FROM "problems"  GROUP BY event_date
               ^
: SELECT "problems".* FROM "problems"  GROUP BY event_date

and i would like to know how many time in each day

Thanks

Re: Group and count

you should try something like these
app/controllers/problems_controller.rb

Problem.find(:all,
                :select => "count(*), event_date, description",
                :group => 'event_date, description'
                )