what will be the output of the below given query, if no
matching records are found : (a.) 0 (b.) null (c.) error

select Avg(salary)
from TableA
where Deptno = 'insurance'

Answer Posted / lalit

Hi,
My understanding is different so it can be a or b. Assume
that there are 10 records and this column can have null
values. If 9 records have null and one record has vale as
zero then the answer would be zero and if all of them have
null then the answer would be null. If no rows satifies the
criteria then it would be null.

Is This Answer Correct ?    5 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is runstats db2?

590


How does coalesce work?

593


Explain about rct in db2?

649


What is the information associated with sysibm.syslinks table?

669


what is the responsibility of the construction superintendent

1673






How to take backup of table in db2?

607


How do I change the column size in db2?

608


What is the use of commit in db2?

639


What is db2 bind?

645


How does db2 sample database connect?

580


Can you tell me how can you find out the # of rows updated after an update statement?

621


How would you find out the total number of rows in a db2 table?

589


How to find the number of rows in a db2 table?

653


What do you mean by between and in? Is between inclusive of specified range values?

678


What is dbrm? When it will be created?

607