dbTalk Databases Forums  

Grouping

comp.database comp.database


Discuss Grouping in the comp.database forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
venu (Offline)
Junior Member
 
Posts: 1
Join Date: Apr 2006

Post Grouping - 04-01-2006 , 09:53 AM






Hi,

I am Venu and I use DB2 V7.2
I wanted to know how to get the subtotals for the below table structure

Date Name Earnings
1-Apr-2006 Andy 100
1-Apr-2006 Cathy 100
1-Apr-2006 Andy 100
1-Apr-2006 Cathy 100
2-Apr-2006 Andy 300
2-Apr-2006 Cathy 300
2-Apr-2006 Andy 300
2-Apr-2006 Cathy 300


Expecting Result:
----------------
Date Name Earnings
1-Apr-2006 Andy 200
Cathy 200
400
2-Apr-2006 Andy 600
Cathy 600
1200

Please let me know if the above result is achievable
Thanks
Venu

Reply With Quote
  #2  
Old   
No bother
 
Posts: n/a

Default Re: Grouping - 04-03-2006 , 04:36 PM






Does DB2 have the standard group by implementation? If so, have you
tried that?

venu wrote:
Quote:
Hi,

I am Venu and I use DB2 V7.2
I wanted to know how to get the subtotals for the below table
structure

Date Name Earnings
1-Apr-2006 Andy 100
1-Apr-2006 Cathy 100
1-Apr-2006 Andy 100
1-Apr-2006 Cathy 100
2-Apr-2006 Andy 300
2-Apr-2006 Cathy 300
2-Apr-2006 Andy 300
2-Apr-2006 Cathy 300


Expecting Result:
----------------
Date Name Earnings
1-Apr-2006 Andy 200
Cathy 200
400
2-Apr-2006 Andy 600
Cathy 600
1200

Please let me know if the above result is achievable
Thanks
Venu



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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.