+ 5

What is the difference between NVL and NVL2 functions ?

19th Jul 2016, 8:26 AM
Ashutosh Singh
2 Answers
+ 3
nvl has only 2 arguments whereas nvl2 has 3 arguments. Both function operates on any datatype pertaining to null values. example nvl (comm,0) will give you comm when not null otherwise it will return 0. nvl2(comm,1,0) will give you 1 when comm is not null and 0 when comm is null.
22nd Jul 2016, 5:43 PM
Saurabh Joshi
Saurabh Joshi - avatar
oracle has nvl2? i know nvl but havent heard of nvl2 before
12th Jan 2017, 8:06 PM
Hakkı Karahan
Hakkı Karahan - avatar