User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the MS SQL section within the Web Development category of DaniWeb, a massive community of 402,738 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,466 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MS SQL advertiser: Programming Forums

SQL SERVER 2000 Selecting a record based on an aggregate function

Join Date: Sep 2007
Posts: 2
Reputation: AlanJ1 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
AlanJ1 AlanJ1 is offline Offline
Newbie Poster

Re: SQL SERVER 2000 Selecting a record based on an aggregate function

  #9  
Sep 18th, 2007
Originally Posted by DawnLane View Post
Every column in your select statement that is not used in an aggregate function MUST be included in the GROUP BY clause. For example,
Select Col1, Col2, Col3, Sum(Col4)
from sf_articles
group by Col1, Col2, Col3


I too was confused by this error message, and found your post. It was succinct, and helpful. Thank you.

Alaln
Reply With Quote  
All times are GMT -4. The time now is 7:35 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC