SQL: expression of select is not in group by clause and contains nonaggregated column
Q: expression of select is not in group by clause and contains nonaggregated column, how to fix?
A: columns list in SELECT should match columns list in GROUP BY except aggregated columns like SUM, AVG, MIN, MAX, COUNT.