Sunday, December 29, 2013

SQL Query Totals Grouping Subtotals

Group by requires aggregate function (AVG, SUM, ...) and chances are you didn't use any aggregate function that's why you're getting an error.


SELECT columnName, aggregateFunction(columnName)

FROM tableName

WHERE columnName ...

GROUP BY columnName;


No comments:

Post a Comment