Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
problem is average function

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
meetsrk

New User


Joined: 13 Jun 2004
Posts: 85

PostPosted: Tue Jul 06, 2004 9:50 pm    Post subject: problem is average function
Reply with quote

hi ppl,

when we are using average function in a query for a table where some of the salary are null then wat will be the output of the following query,

Code:

select avg(salary) from emp


say emp has 10 records out of which 3 records are having NULL value.

so will it calculate the sum of the all the salaries irrespective of NULL(taking nulls as zero) and divides by 10.

or

will it calculate the sum of all the salaries which does not have NULL and divide it by 7
Back to top
View user's profile Send private message

imvs

New User


Joined: 12 May 2004
Posts: 33

PostPosted: Tue Jul 06, 2004 11:28 pm    Post subject:
Reply with quote

check the second question of this post
http://ibmmainframes.com/expertforum/viewtopic.php?t=785
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts LMINIT problem - not finding DDNAME Danielle.Filteau CLIST & REXX 7 Tue Sep 19, 2017 9:57 pm
No new posts Problem commiting to DB2 from IMS MPP Ole Soerensen IMS DB/DC 2 Wed Jul 26, 2017 5:19 pm
No new posts What is the Extract Function in JCL dharmaraok JCL & VSAM 3 Wed Jun 14, 2017 9:12 am
No new posts Strings with double quotes having pro... raja Arumugam All Other Mainframe Topics 11 Thu Mar 30, 2017 10:34 am
No new posts Problem reading GTF trace output danik56 ABENDS & Debugging 7 Thu Mar 16, 2017 1:02 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us