
Recently, I came across issue when trying to include both a group function and individual
column expression.
Cause: A SELECT list cannot
include both a group function and an individual column expression,
unless the individual column expression is included in a GROUP BY clause.
Example:
Workaround:
You can Drop either
the group function or the column expression from the SELECT list or else add
GROUP BY clause that includes all individual column expressions listed.