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

How can we read records for specific member in CL? AND rpg?

442


What do you mean by rollback?

754


What is the function of logging in the db2 database?

857


what is the role of the cursor in db2?

813


How can you classify the locks in db2?

824


What is a db2 schema?

973


What is the difference between "db2ilist" and "db2 get instance" commands in DB2 Database Server?

982


Explain packages.

865


Can there be more than one cursor open for any program?

905


Name the lockable units in DB2?

894


What is database manager in db2?

753


How do you simulate the explain of an embedded sql statement in spufi/qmf?

841


What is db2 and what is the use of db2 optimizer?

832


What is nvl in db2?

819


Outputs of explain are with matchcols = 0. What does this signify?

834