我有这段代码:
@people.count
生成以:
开头的查询SELECT COUNT(*) FROM ( SELECT * .....
这个错误:
column "peoplerelationships.updated_at" must appear in the GROUP BY clause or be used in an aggregate function
LINE 5: ORDER BY peoplerelationships.updat...
如果我只查询@people
,则没有错误。通过请求COUNT
,它会向查询引入聚合函数,从而引入错误。您能否确保首先评估@people
,然后计算?你怎么做得好?