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
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.
What is the maximum number of columns in a db2 table?
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.
How do I create a view in db2?
What is the latest version of ibm db2?
Why cursor is used in db2?
What is lock escalation in db2?
What is the connection string to connect to the DB2 Database ?
What is a trigger in the db2 database?
How to check sequence on a table in db2?
What is release/acquire in bind?
Name the various locking levels available?
can all users have the privilage to use the sql statement select * (dml)?
How to restart a DB2 program?
Mention the way of highlighting as well as putting a cursor to use in a cobol program.