Home Forums SQL Server 2008 SQL Server 2008 - General Query failed (aggregate function or the GROUP BY clause) RE: Query failed (aggregate function or the GROUP BY clause)
Ant-Green
SSC Guru
Points: 113445
More actions
November 15, 2012 at 3:23 am
#1559258
If your using an aggregate function in the select, you need to put in a group by clause of all the columns which are not encased in an aggregate
SELECT name, SUM(population)
FROM bbc
WHERE population >1000
GROUP BY name