Rails 3.1 with PostgreSQL: GROUP BY must be used in an aggregate function

前端 未结 4 1805
再見小時候
再見小時候 2020-12-15 12:30

I am trying to load the latest 10 Arts grouped by the user_id and ordered by created_at. This works fine with SqlLite and MySQL, but gives an error on my new PostgreSQL data

4条回答
  •  爱一瞬间的悲伤
    2020-12-15 12:43

    Take a look at this post SQLite to Postgres (Heroku) GROUP BY

    PostGres is actually following the SQL standard here whilst sqlite and mysql break from the standard.

提交回复
热议问题