Oracle Sql NVL and NVL2 function - What is the Difference? [SQL tutorial]

Опубликовано: 12 Август 2023
на канале: ERP Scope
286
2

NVL and NVL function are a powerful functions in Oracle Sql,
you can use it to convert null values to whatever the values you need.
it will help you make calculations on Oracle database with more accurate results.

NVL Syntax:
===========
NVL (expr1, expr2)
You can use the NVL function to convert any data type, but the return value is always the same as the data type of expr1.

NVL2 Syntax:
===========
NVL2 (expr1, expr2, expr3)
The NVL2 function examines the first expression. If the first expression is not null, then the NVL2 function returns the second expression. If the first expression is null, then the third expression is returned.

NVL function example:
SELECT last_name, salary, NVL(commission_pct, 0),
(salary*12) + (salary*12*NVL(commission_pct, 0)) AN_SAL
FROM employees;

NVL2 function example:
SELECT last_name, salary, commission_pct,
NVL2(commission_pct,
'SAL+COMM', 'SAL') income
FROM employees WHERE department_id IN (50, 80);

Chapters:
0:00 Intro
0:25 NVL function Syntax.
1:08 NVL function example.
3:33 NVL2 function Syntax.
4:07 NVL2 function example.
6:30 How to install the same database on your machine.

✅ To install the same database in examples, please check this video:
   • How to install Oracle Sample Database sche...  

✅ How to become oracle expert atrical:
https://erpscope.com/how-to-become-or...

✅ linkedin :   / posts  

✅Facebook:   / erpscope  

✅ Twitter:   / erp_scope  

✅Instagram:   / erp_scope  

✅ Youtube:    / @erpscope  


На этой странице сайта вы можете посмотреть видео онлайн Oracle Sql NVL and NVL2 function - What is the Difference? [SQL tutorial] длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь ERP Scope 12 Август 2023, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 286 раз и оно понравилось 2 зрителям. Приятного просмотра!