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 / rama krishna reddy

b

if no matching records found then it will return null value

Is This Answer Correct ?    36 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

SET is the ANSI standard for variable assignment, SELECT is not. SET can only assign one variable at a time, SELECT can make multiple assignments at once. If assigning from a query, SET can only assign a scalar value. If the query returns multiple values/rows then SET will raise an error. SELECT will assign one of the values to the variable and hide the fact that multiple values were returned (so you'd likely never know why something was going wrong elsewhere - have fun troubleshooting that one) When assigning from a query if there is no value returned then SET will assign NULL, where SELECT will not make the assignment at all (so the variable will not be changed from it's previous value) As far as speed differences - there are no direct differences between SET and SELECT. However SELECT's ability to make multiple assignments in one shot does give it a slight speed advantage over SET.

2141


What is the maximum number of columns in a db2 table?

710


Hello All, We have requirment to Replace BMC Db2 Load product thru CA FAST LOADPlus product. Do anyone have JCL to for FAST LOADPLUS and what all are thing need to take in consideration.

2316


How do I create a view in db2?

595


What is the latest version of ibm db2?

728






Why cursor is used in db2?

567


What is lock escalation in db2?

566


What is the connection string to connect to the DB2 Database ?

606


What is a trigger in the db2 database?

588


How to check sequence on a table in db2?

593


What is release/acquire in bind?

641


Name the various locking levels available?

623


can all users have the privilage to use the sql statement select * (dml)?

630


How to restart a DB2 program?

1353


Mention the way of highlighting as well as putting a cursor to use in a cobol program.

620