Group by Error: PG::GroupingError: ERROR: column must appear in the GROUP BY clause or be used in an aggregate function
PostgreSQL -must appear in the GROUP BY clause or be used in an aggregate function