What does the following query do?

SELECT SAL + NVL(COMM,0) FROM EMP;

This displays the total salary of all employees. The null values in the commission column will be replaced by 0 and added to salary.

Showing Answers 1 - 3 of 3 Answers

prasath

  • Dec 26th, 2005
 

SELECT SAL + NVL(COMM,0) FROM EMP;

       It gives the added value of sal and comm for each employee in the emp table.

     NVL(null value) replaces null with 0.

chengiri

  • Sep 3rd, 2009
 

Insted of NVL use
SELECT SAL + isnull(COMM,0) FROM EMP which will convert null values to 0 of the field COMM

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions