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 > Simple Query Question

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-07-05, 18:49
jasoberai jasoberai is offline
Registered User
 
Join Date: Jan 2005
Posts: 18
Simple Query Question

Hi Friends,
I've a simple question.I am using the SUM function in my query with the group by clause.I just need to get the total elements that were used to calculate the sum.If i use the COUNT on the same column,will it give me the answer.Please help me.
Reply With Quote
  #2 (permalink)  
Old 02-07-05, 21:40
jacampbell jacampbell is offline
Registered User
 
Join Date: Jan 2005
Posts: 191
Not necessarily. SUM will not include nulls, COUNT will include the rows with the nulls.

James Campbell
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