Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2000 > SQL Server 2000
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 9th, 2007, 10:12 PM
Authorized User
 
Join Date: Jul 2006
Location: Pukekohe, , New Zealand.
Posts: 38
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to use the SUM Aggregate

HI

I have a table (below)and would like to add (sum) COL_D where COL_E is the same.

Your help is appreciated.
Greg


COL_A COL_B COL_C COL_D COL_E
03710/030.00 2007 5/02/2007 107.34 2487832
03710/030.00 2007 5/03/2007 134.88 2498785
03710/030.00 2007 6/06/2006 0.01 2363813
03710/030.00 2007 20/12/2006 134.88 2474110
03710/031.00 2007 23/11/2006 505.3 2451972
03710/031.00 2007 23/11/2006 561.45 2451972
03710/031.00 2007 23/11/2006 617.59 2451972
03710/032.00 2007 14/09/2006 485.06 2420321
03710/032.00 2007 14/09/2006 538.9 2420321
03710/032.00 2007 14/09/2006 592.79 2420321
03710/033.00 2007 1/02/2007 134.94 2486569
03710/033.00 2007 1/03/2007 27.25 2497071
03710/033.00 2007 1/03/2007 141.43 2497071
03710/033.00 2007 1/08/2006 125.21 2390416
03710/033.00 2007 1/09/2006 134.94 2414429


Reply With Quote
  #2 (permalink)  
Old May 10th, 2007, 01:19 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Bangalore, KA, India.
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Is this what you are looking for?
Code:
Select Sum(Col_D), Col_E
GROUP BY Col_E
Cheers

_________________________
- Vijay G
Strive for Perfection
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
aggregate function polofson BOOK: Professional SQL Server 2005 Reporting Services ISBN: 0-7645-8497-9 0 August 14th, 2007 01:29 PM
Help: Running Sum (or Cumulative Sum) timdasa VB Databases Basics 1 August 22nd, 2006 03:12 PM
Aggregate Function MAX, SUM Manu SQL Language 2 May 30th, 2006 04:40 AM
Aggregate with Group By hugh@kmcnetwork.com SQL Language 4 March 29th, 2004 08:39 AM
Aggregate Sum Problem akc SQL Server 2000 2 November 4th, 2003 10:07 AM



All times are GMT -4. The time now is 07:04 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.