Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

difference between nvl(max(empno),0) and max(nvl(empno,0))

441475Jun 28 2005 — edited Jun 28 2005
i have an empty table and iwant to select the max(empno)+1,so i write the following
select max(nvl(empno,0)+1 from emp;
the result was a null value

but
select nvl(max(empno),0)+1 from emp
the result was 1

i can not understand the differnce between the two sql statments.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 26 2005
Added on Jun 28 2005
2 comments
7,401 views