If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > SUM query

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-13-04, 10:26
manth manth is offline
Registered User
 
Join Date: Mar 2004
Posts: 54
SUM query

Hi,

I have data in my STAT table as follows

TSTAMP QMGR QNAME ENQ DEQ
... .. ...... 59 1
.. .. ... 59 29
... .. ... 59 58

... e.t.c

I want out put as follows

QMGR QNAME Total Enqueues Total Dequeues
PQM1 CUST.LOC 1000 1000
QMBK XML.PS.CS 800 1200

... e.t.c

So i wrote my query like this
db2 => SELECT QMGR, QNAME, SUM(ENQ), SUM(DEQ) FROM DB2A.STAT GROUP BY QMGR, QNAME

it seams, it did not give me sum of ENQ, DEQ are correct.

Please correct me

Thanks
Reply With Quote
  #2 (permalink)  
Old 04-13-04, 11:05
manth manth is offline
Registered User
 
Join Date: Mar 2004
Posts: 54
Sorry, i guess it's working correct.
if you don't agree please let me know the correct one.

Thanks
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 On
Pingbacks are On
Refbacks are On