Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2000 > SQL Server 2000
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 9th, 2007, 10:12 PM
Authorized User
 
Join Date: Jul 2006
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


 
Old May 10th, 2007, 01:19 AM
Friend of Wrox
 
Join Date: Jun 2003
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





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





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