﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / SQL Server 2008 / SQL Server 2008 - General  / Query failed (aggregate function or the GROUP BY clause) / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Thu, 20 Jun 2013 01:50:03 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Query failed (aggregate function or the GROUP BY clause)</title><link>http://www.sqlservercentral.com/Forums/Topic1385037-391-1.aspx</link><description>SELECT name as Name, SUM(population) as PopualtionFROM bbcWHERE population &amp;gt;1000GROUP BY name If you aggregate the specific column then other remaining column in the select list should be group by...</description><pubDate>Thu, 15 Nov 2012 03:34:29 GMT</pubDate><dc:creator>farooq.hbs</dc:creator></item><item><title>RE: Query failed (aggregate function or the GROUP BY clause)</title><link>http://www.sqlservercentral.com/Forums/Topic1385037-391-1.aspx</link><description>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 aggregateSELECT name, SUM(population)FROM bbcWHERE population &amp;gt;1000GROUP BY name</description><pubDate>Thu, 15 Nov 2012 03:23:58 GMT</pubDate><dc:creator>anthony.green</dc:creator></item><item><title>Query failed (aggregate function or the GROUP BY clause)</title><link>http://www.sqlservercentral.com/Forums/Topic1385037-391-1.aspx</link><description>SAMPLE QUERY :SELECT name,  SUM(population)  FROM bbc  where population &amp;gt;1000query failed and got error msg  8120ERROR "Column 'tt.dbo.bbc.name' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause."I want to select name and corresponding sum (population) ..help???</description><pubDate>Thu, 15 Nov 2012 03:20:05 GMT</pubDate><dc:creator>sumith1andonly1</dc:creator></item></channel></rss>