PGError: ERROR: column "visits.id" must appear in the GROUP BY clause
or be used in an aggregate function
If I add visits.id to the group by clause, then it asks me to add
another column, then another, then another. Basically I have to list all
columns in the table!
What's going wrong? From the Rails guide it seemed straightforward.
I checked my install and received the same results. Looks like a
PostgreSQL syntax thing. I'm new to PostgreSQL and have not looked at
group by SQL syntax.
Off the top of my head, as a (non recommended) work around, you could
insert a .select() with a column list, and it should work. That,
however, is a bad solution for obvious reasons, but might work in a
pinch.