geddy / model

Datastore-agnostic ORM in JavaScript
265 stars 55 forks source link

PG 9.3: ERROR column "foobar.created_at" must appear in the GROUP BY clause or be used in an aggregate function #254

Closed der-On closed 9 years ago

der-On commented 9 years ago

This happens with a count query incudling a sort:

{ 
  sort: { created_at: "desc" } 
}
der-On commented 9 years ago

Solution is to use a group-by as aggregated functions require this.