Skip to content

Instantly share code, notes, and snippets.

@noahhendrix
Created August 9, 2010 16:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save noahhendrix/515696 to your computer and use it in GitHub Desktop.
Save noahhendrix/515696 to your computer and use it in GitHub Desktop.
ActiveRecord::StatementInvalid: PGError: ERROR: column "sales.id" must appear in the GROUP BY clause or be used in an aggregate function
: SELECT "sales".* FROM "sales" WHERE (branch_name = 'St. Joseph') AND ("sales"."invoiced_on" = '2010-08-09') GROUP BY date_part('year', invoiced_on)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment