NVL function
What is NVL function?
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Satyapriya NayakRank #47 · 31.5K reputationPosted Nov 23, 2011, 12:11 AM EST
The NVL() function is used to replace NULL value with another value. It is similar to the IFNULL Function in MySQL and the ISNULL Function in SQL Server.
store_name Sales
Store A 300
Store B NULL
Store C 150
SELECT SUM(NVL(Sales,100)) FROM Sales_Data;
It returns 550. This is because NULL has been replaced by 100 via the ISNULL function, hence the sum of the 3 rows is 300 + 100 + 150 = 550.
Thanks
Pravin MoreRank #1,419 · 1.2K reputationPosted Nov 23, 2011, 12:18 AM EST
NVL() function is used to specify how we want to treat with NULL values in sql.
for.e.g:-
SELECT Name,NVL(Amount,0)) FROM TableName
so above will return 0 when Amount is Null.
its same like ISNULL() and COALESCE()
Thanks,
Pravin.