更新时间:2023-09-16 23:35:52
不允许选择reviews.id
(通过通配符*
隐式选择)而不添加将其添加到 GROUP BY
子句或应用聚合函数,如 avg()
.解决方案是执行以下操作之一:
You are not allowed to select reviews.id
(selected implicitly through the wildcard *
) without adding it to the GROUP BY
clause or applying an aggregate function like avg()
. The solution is to do one of the following:
*
reviews.id
添加到您的组子句中reviews.id
并对其应用聚合函数(例如 sum(reviews.id)
)*
替换为特定于表的通配符 albums.*
*
from your selectreviews.id
to your group clausereviews.id
explicitly and apply an aggregate function to it (e.g. sum(reviews.id)
) *
with the table-specific wildcard albums.*
第二个和第三个选项在您的场景中没有多大意义.根据您的评论,我添加了选项四.
The second and third option do not make much sense in your scenario though. Based on your comment, I added option four.