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 / shailendra
It will be error, as we are using where with AVG function....we should use having
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What's The Percentage Free Space ?
Define db2 and its databases?
How to create backup table in db2?
What is a db2 tablespace?
What do you mean by storage group (stogroup)?
What is buffer pool in the db2 database?
Is it possible to alter a table – for example adding a column, when another user is accessing or updating some columns?
What is db2 bind?
Mention the downsides of page level lock.
What are concurrency issues?
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.
Describe major components of db2?
Give the name of some fields form sqlca.
What does reorg do in db2?
Why db2 is called db2?