what is the right way to get an average number from a column? i have this query:
q = from r in Review,
where: r.module_id == ^module_id,
where: r.delete == false,
select: %{entries: r, stars: avg(r.stars)}
r = Repo.all(q)
will always get this error:
(grouping_error) column "r0.id" must appear in the GROUP BY clause or be used in an aggregate function
what do that means and how to resolve that?