Ok...I had read a message that mentioned the aggregate function
requirement...but
how would I write my example query to include an (unneeded?) aggregate
function?

(And why would there be an aggregate requirement anyway?)


Query (MySQL version):

Select * from books group by genre



-----Original Message-----
From: Alan Rother [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, June 13, 2006 12:31 PM
To: CF-Talk
Subject: Re: Group By function for MS SQL Server Express 2005?

Here is a simple example using the Northwind database in SQL Server


The key to the GROUP BY clause is that is needs to be used in aggregate
functions


SELECT COUNT(P.ProductID) AS ItemTotal, C.CategoryName FROM Products AS P
INNER JOIN Categories AS C ON P.CategoryID = C.CategoryID GROUP BY
P.CategoryID, C.CategoryName





~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:243364
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to