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