We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The gem adds the SELECT expressions like
"jobs"."id" AS t0_r0, "jobs"."job_description" AS t0_r1, .......
They cause error when using COUNT and GROUP BY functions in Postgres:
PG::GroupingError: ERROR: column "jobs.id" must appear in the GROUP BY clause or be used in an aggregate function
How can I remove them from the query?
P.S.
The rails code is:
states = Job.joins(listing: :location).select('count(locations.state) as count, locations.state').group('locations.state')
The text was updated successfully, but these errors were encountered:
I'm having a similar problem when grouping. I'd be happy with a hack for the time being to get this working.
Sorry, something went wrong.
+1 I am trying to join a third table and select columns from it in vain. Does anyone know of a way to select required columns from third table?
Use .unscoped to remove the default_scope
No branches or pull requests
The gem adds the SELECT expressions like
"jobs"."id" AS t0_r0, "jobs"."job_description" AS t0_r1, .......
They cause error when using COUNT and GROUP BY functions in Postgres:
PG::GroupingError: ERROR: column "jobs.id" must appear in the GROUP BY clause or be used in an aggregate function
How can I remove them from the query?
P.S.
The rails code is:
states = Job.joins(listing: :location).select('count(locations.state) as count, locations.state').group('locations.state')
The text was updated successfully, but these errors were encountered: